Skip to content

MicroPython implementation and tests #96

Description

@bskinn

MicroPython types appear not to implement .mro(), in either the Python 2 or Python 3 forms:

>>> str.__bases__
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: type object 'str' has no attribute '__bases__'
>>> import io
>>> io.StringIO.__bases__
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: type object 'StringIO' has no attribute '__bases__'
>>> io.StringIO.__mro__
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: type object 'StringIO' has no attribute '__mro__'
>>> dir(io.StringIO)
['__class__', '__enter__', '__exit__', '__name__', 'close', 'read', 'readinto', 'readline', 'write', 'flush', 'getvalue', 'seek']

Is there a way to introspect the inheritance hierarchy in MP?

Also: Yikes, the MRO itself is not CPython-compliant.

Adapted from original post by @bskinn in #81 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs testsTests are absent or incomplete for thistodoDefinitely needs doing for a near-term release

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions