[Python-ideas] PEP 426, YAML in the stdlib and implementation discovery

Philipp A. flying-sheep at web.de
Fri May 31 21:39:54 CEST 2013


2013/5/31 Masklinn <masklinn at masklinn.net>

> On 2013-05-31, at 20:43 , Andrew Barnert wrote:
> >     try:
> >         from lxml import etree as ET
> >     except ImportError:
> >         from xml.etree import ElementTree as ET
> >
> > Your registration mechanism would mean they don't have to do this; they
> just import from the stdlib, and if lxml is present and registered, it
> would be loaded instead.
>
> That seems rife with potential issues and unintended side-effects e.g.
> while lxml does for the most part provide ET's API, it also extends it
> and I do not know if it can run ET's testsuite. It also doesn't handle
> ET's implementation details for obvious reasons.
>

 and that’s where my idea’s “strict API” comes into play: compatible
implementations would *have to* pass a test suite and implement a certain
API and comply with the standard.

unsure if and how to test the latter (surely running a testsuite when
something wants to register isn’t practical – or is it?)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130531/f9f7eda9/attachment.html>


More information about the Python-ideas mailing list