Repository: ets-labs/python-dependency-injector

Issue:
Broken order of complex inheritance
Hello everyone. 
In version 4.46.0 the order of complex inheritance has been broken. 

```python
from dependency_injector import containers, providers, __version__
from dependency_injector.wiring import Provide, inject


class GrandBase:
    @inject
    def __init__(self, *args, service=Provide['service'], **kwargs):
        print('GrandBase')

        super().__init__()


class Base1(GrandBase):
    ...


class Base2(GrandBase):
    def __init__(self, *args, **kwargs):
        print('Base2')

        super().__init__(*args, **kwargs)


class SubClass(Base1, Base2):
    ...


class Container(containers.DeclarativeContainer):
    service = providers.Object('service')


container = Container()

container.wire(modules=[__name__])

print(f"dependency_injector: {__version__}")

SubClass()
```

In version 4.45.0:
```
dependency_injector: 4.45.0
Base2
GrandBase
```
In version 4.46.0:
```
dependency_injector: 4.46.0
GrandBase
```

Discussion:
coveralls: 
[![Coverage Status](https://coveralls.io/builds/73720986/badge)](https://coveralls.io/builds/73720986)

coverage: 94.956% (+0.003%) from 94.953%
when pulling **3918913028e2042904bc3db4b320ba283869206f on fix/wiring-mro**
into **9a08bfcede003d5e0f8cf7cfdb11a1b3db7ceef9 on develop**.


Fix (patch):
diff --git a/src/dependency_injector/wiring.py b/src/dependency_injector/wiring.py
index a67cf76b..1effd16f 100644
--- a/src/dependency_injector/wiring.py
+++ b/src/dependency_injector/wiring.py
@@ -523,6 +523,10 @@ def _patch_method(
 
     _bind_injections(fn, providers_map)
 
+    if fn is method:
+        # Hotfix, see: https://github.com/ets-labs/python-dependency-injector/issues/884
+        return
+
     if isinstance(method, (classmethod, staticmethod)):
         fn = type(method)(fn)
 


Test changes:
diff --git a/tests/unit/wiring/test_no_interference.py b/tests/unit/wiring/test_no_interference.py
new file mode 100644
index 00000000..21f8b0e9
--- /dev/null
+++ b/tests/unit/wiring/test_no_interference.py
@@ -0,0 +1,40 @@
+from typing import Any, Iterator
+
+from pytest import fixture
+
+from dependency_injector.containers import DeclarativeContainer
+from dependency_injector.providers import Object
+from dependency_injector.wiring import Provide, inject
+
+
+class A:
+    @inject
+    def foo(self, value: str = Provide["value"]) -> str:
+        return "A" + value
+
+
+class B(A): ...
+
+
+class C(A):
+    def foo(self, *args: Any, **kwargs: Any) -> str:
+        return "C" + super().foo()
+
+
+class D(B, C): ...
+
+
+class Container(DeclarativeContainer):
+    value = Object("X")
+
+
+@fixture
+def container() -> Iterator[Container]:
+    c = Container()
+    c.wire(modules=[__name__])
+    yield c
+    c.unwire()
+
+
+def test_preserve_mro(container: Container) -> None:
+    assert D().foo() == "CAX"