On Tue, Feb 21, 2012 at 1:55 AM, <martin at v.loewis.de> wrote: >> Basically, if something is just documented as being callable without >> subclassing or instance checks being mentioned as supported in the >> docs, it can be implemented as either a type or an ordinary function, >> or pretty much any other kind of callable without being deemed an API >> change > > > So what would be your evaluation of > > http://docs.python.org/library/xml.etree.elementtree.html#xml.etree.ElementTree.Element > > in that respect? Completely different from the functools.partial case - with that, the docs are very careful to *never* call functools.partial a class (instead saying "returns a callable object"). The ElementTree docs unambiguously call Element a class (several times), so a conforming implementation must provide it as a class (i.e. supporting use in isinstance() checks. inheritance, etc) rather than as just a callable. A factory function is not a backwards compatible replacement (sorry Eli - given those docs, I'm definitely with Martin on this one). Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4