diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2017-07-09 13:32:17 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2017-07-09 13:32:17 +0300 |
commit | b2979023ac049cdd1bb4d66761c3b0648387a1b3 (patch) | |
tree | 3e4729516830a9639372a5b16da34c4afbeec841 /tests | |
parent | bfa68ef6b23a2bca9d4a713ea436d76c62633078 (diff) | |
download | micropython-b2979023ac049cdd1bb4d66761c3b0648387a1b3.tar.gz micropython-b2979023ac049cdd1bb4d66761c3b0648387a1b3.zip |
tests/cpydiff/core_class_mro: Move under Classes, add workaround.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/cpydiff/core_class_mro.py | 15 | ||||
-rw-r--r-- | tests/cpydiff/core_mro.py | 15 |
2 files changed, 15 insertions, 15 deletions
diff --git a/tests/cpydiff/core_class_mro.py b/tests/cpydiff/core_class_mro.py new file mode 100644 index 0000000000..99713e790c --- /dev/null +++ b/tests/cpydiff/core_class_mro.py @@ -0,0 +1,15 @@ +""" +categories: Core,Classes +description: Method Resolution Order (MRO) is not compliant with CPython +cause: Depth first non-exhaustive method resolution order +workaround: Avoid complex class hierarchies with multiple inheritance and complex method overrides. Keep in mind that many languages don't support multiple inheritance at all. +""" +class Foo: + def __str__(self): + return "Foo" + +class C(tuple, Foo): + pass + +t = C((1, 2, 3)) +print(t) diff --git a/tests/cpydiff/core_mro.py b/tests/cpydiff/core_mro.py deleted file mode 100644 index 35b898b303..0000000000 --- a/tests/cpydiff/core_mro.py +++ /dev/null @@ -1,15 +0,0 @@ -""" -categories: Core -description: Method Resolution Order (MRO) is not compliant with CPython -cause: Unknown -workaround: Unknown -""" -class Foo: - def __str__(self): - return "Foo" - -class C(tuple, Foo): - pass - -t = C((1, 2, 3)) -print(t) |