Movatterモバイル変換
[0]ホーム
[Python-Dev] folding cElementTree behind ElementTree in 3.3
Nick Coghlanncoghlan at gmail.com
Mon Feb 20 23:51:34 CET 2012
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, thedocs are very careful to *never* call functools.partial a class(instead saying "returns a callable object").The ElementTree docs unambiguously call Element a class (severaltimes), so a conforming implementation must provide it as a class(i.e. supporting use in isinstance() checks. inheritance, etc) ratherthan as just a callable. A factory function is not a backwardscompatible replacement (sorry Eli - given those docs, I'm definitelywith Martin on this one).Cheers,Nick.-- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
More information about the Python-Devmailing list
[8]ページ先頭