Author lukasz.langa
Recipients ecatmur, gvanrossum, lukasz.langa, rhettinger
Date 2013-06-30.13:39:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1372599592.03.0.551921614456.issue18244@psf.upfronthosting.co.za>
In-reply-to
Content
Having all information in place, I think it's acceptable for both of us
to implement preference for explicit registration, leaving both ways of
implicit registration as equally binding. The latter is future proof in
the sense that if we change our minds later, it's going to be easier to
lift the dispatch conflict than to introduce conflicts where there
weren't any before.

The point you're making about `Abc.register(Cls)` being external to the
definition of Cls and thus somewhat dependant on import order and other
machinery is what convinced me in the end. I also like the proposed
terminology and think it should appear in the documentation.

I created a modified patch. This wasn't as tricky as I feared but
required me to formulate an explicit rule: all implicit ABCs are
inserted in the MRO of a given class directly after the last explicit
ABC in the MRO of said class. One open question is what to do with the
algorithm described in PEP 443 which no longer describes the state of
things exactly. Although the said PEP is final, some parts of the
discussion on this issue just beg to be included in the "Abstract base
classes" section. What do you think we should do?

Answering your questions, neither scanning the source code nor using
a private attribute on ABCMeta can be considered an *obvious* way to
distinguish between registered and inferred ABCs. The former is static
analysis which might involve opening (and understanding) a number of
black boxes, the latter is fragile by definition and breaks the
abstraction (again, opening a black box). This is why we introduced
a public API to get the current cache token [1]_. As for dispatch
differences between MutableMapping and dict, it's in my previous message
(191947) on the issue, classes G and H.

On an unrelated note, thank you for correcting my English. It seems that
after achieving a level of fluency that is bearable to native speakers,
nobody corrects my mistakes anymore. This in turn places me in an
unfortunate plateau.

And yes, I'm well aware that my gut would win no popularity contest,
especially when the BDFL's one is a contender :-) I just hope this
doesn't automatically make the feelings of my own gut invalid.

.. [1] http://bugs.python.org/issue16832
History
Date User Action Args
2013-06-30 13:39:52lukasz.langasetrecipients: + lukasz.langa, gvanrossum, rhettinger, ecatmur
2013-06-30 13:39:52lukasz.langasetmessageid: <1372599592.03.0.551921614456.issue18244@psf.upfronthosting.co.za>
2013-06-30 13:39:52lukasz.langalinkissue18244 messages
2013-06-30 13:39:51lukasz.langacreate