On Tue, Feb 21, 2012 at 1:55 AM, <mar...@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 | ncogh...@gmail.com | Brisbane, Australia _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com