homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Make importlib.abc more inheritance-friendly
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: brett.cannon Nosy List: brett.cannon, eric.snow, gkcn, python-dev
Priority: low Keywords: easy

Created on 2013年01月31日 21:06 by brett.cannon, last changed 2022年04月11日 14:57 by admin. This issue is now closed.

Messages (5)
msg181044 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2013年01月31日 21:06
ABCs, even though they are almost always at the bottom of an inheritance hierarchy, should still do the right thing in the face of being in the middle of an MRO. That means that they should call super() as appropriate. So for methods that return a value, blindly call super(). For methods that do not necessarily return anything (e.g. invalidate_caches()), check if super() as the method and it is callable and if that is true then make the super() call.
This is not backwards-compatible as it is new semantics people will rely on, but neither is it a bug but a bad design decision on my part.
msg181085 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2013年02月01日 16:25
Blog post I wrote explaining what I plan to do: http://sayspy.blogspot.ca/2013/02/remember-to-use-super-in-your-abcs.html 
msg181112 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2013年02月01日 21:46
OK, rewrote that blog post as Thomas pointed out my thinking was worrying about stuff I shouldn't be: http://sayspy.blogspot.ca/2013/02/remember-to-use-super-in-your-abcs.html 
msg181115 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2013年02月01日 21:48
And as part of this I need to update the docstrings to mention default reactions.
msg186449 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013年04月09日 21:03
New changeset 8e733e30edf6 by Brett Cannon in branch 'default':
Issue #17093,17566,17567: Methods from classes in importlib.abc now raise/return
http://hg.python.org/cpython/rev/8e733e30edf6
New changeset 7e91dc7221d5 by Brett Cannon in branch 'default':
What's new entry for issue #17093
http://hg.python.org/cpython/rev/7e91dc7221d5 
History
Date User Action Args
2022年04月11日 14:57:41adminsetgithub: 61295
2013年04月09日 21:04:15brett.cannonsetstatus: open -> closed
resolution: fixed
stage: test needed -> resolved
2013年04月09日 21:03:49python-devsetnosy: + python-dev
messages: + msg186449
2013年02月23日 19:43:57gkcnsetnosy: + gkcn
2013年02月01日 21:48:02brett.cannonsetmessages: + msg181115
2013年02月01日 21:46:08brett.cannonsetmessages: + msg181112
2013年02月01日 16:25:10brett.cannonsetmessages: + msg181085
2013年02月01日 00:17:29eric.snowsetnosy: + eric.snow
2013年01月31日 21:06:51brett.cannonsetassignee: brett.cannon
2013年01月31日 21:06:41brett.cannoncreate

AltStyle によって変換されたページ (->オリジナル) /