Skip to content

Commit b297902

Browse files
committed
tests/cpydiff/core_class_mro: Move under Classes, add workaround.
1 parent bfa68ef commit b297902

2 files changed

Lines changed: 15 additions & 15 deletions

File tree

tests/cpydiff/core_class_mro.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
"""
2+
categories: Core,Classes
3+
description: Method Resolution Order (MRO) is not compliant with CPython
4+
cause: Depth first non-exhaustive method resolution order
5+
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.
6+
"""
7+
class Foo:
8+
def __str__(self):
9+
return "Foo"
10+
11+
class C(tuple, Foo):
12+
pass
13+
14+
t = C((1, 2, 3))
15+
print(t)

tests/cpydiff/core_mro.py

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)