-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
RFC: class.mro() is notimpl #5106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
For efficiency purposes, the MicroPython MRO doesn't match CPython, let alone support overriding it with So perhaps fixing the MRO behaviour first would make sense before adding |
i don't think mro order does matter in that case : the point is accessing Doing that with a function seems to have less cost than a dunder and static tuple and also bring more script compatibilty ( Also maybe that function - when not on MCU target - could check for a user defined edit/ i may be biased because i prefer MicroPython mro . |
I think if you're going to support them, you should match CPython. The two examples you gave sound to me like they would provide the opposite behaviour -- i.e. custom Could you provide an example use case for how you'd use these three features? Do you want to modify the MRO, inspect the MRO, or inspect the list of base classes? Why do proxy objects need this? |
@jimmo external ffi classes or rpc proxy objects that need attr resolution in bases classes for example with C++ see : only inspection of bases / mro is required, as shown here https://github.com/pmp-p/panda3d-interrogator/blob/master/interrogator/uplusplus.py#L285 Full depth would be great but really not critical that's not every day use cases and recursion can solve depth if needed. another reason for not using |
no i should not. if i need polymorphism and multiple inheritance i use cPython on a supported platform. Single inheritance is sufficient and is KISS enough in the context (spirit?) of MicroPython. If Python language provides correctly its base functions those can be user implemented in pure Python. RFC is about what's MISSING for Python compliance not what to ADD. => MUST at least provide read only values. Do i need to sum up (again) what's really missing after 2 years of use ?
sidenote for missing ones that can be reimplemented for user classes (and that's all needed)
as anyone can see it's few ! is it possible to trade execfile() for any of those ? people seems to live fine with compile and exec.
What are you talking about and why ? MRO is broken ? please go fix it asap because i guess Python would not work without that. the cpython
|
The reason was explained to you less then a month ago in an issue you created specifically for it :)
Not sure what you mean exactly, but if anything gets implemented, for such a core feature we cannot really deviate from the standard imo and there's only one type of finalizer? |
See #525 for related discussion about implementation of MRO. |
https://docs.python.org/3.5/library/stdtypes.html#class.mro
Lack of it can be annoying for writing proxy objects, missing
.__bases__
and no mro() means no access to class hierachy at runtime for user defined classes.The text was updated successfully, but these errors were encountered: