← index #525Issue #3376
Related · high · value 0.269
QUERY · ISSUE

Method Resolution Order (MRO) is not compliant

openby pfalconopened 2014-04-28updated 2024-08-28
py-core

uPy currently implements depth-first MRO, which is equivalent to one used pre-Python2.2.
References:

  • http://python-history.blogspot.com/2010/06/method-resolution-order.html
  • https://www.python.org/download/releases/2.3/mro/
CANDIDATE · ISSUE

unix: dir() of a subclass instance does not show superclass methods

closedby peterhinchopened 2017-10-18updated 2018-02-19

This behaviour differs from CPython. Apologies if this is by design:

class FooSub():
    def bar(self):
        pass
 
class Foo(FooSub):
    def rats():
        pass
 
foo = Foo()
dir(foo)

Outcome:

['__module__', 'rats', '__qualname__']

Tab completion also fails to access bar().

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied