On Apr 09, 2010, at 11:05 PM, Antoine Pitrou wrote:

>« Instead, this PEP proposes to add a mapping between internal magic numbers 
>and a user-friendly tag. Newer versions of Python can add to this mapping so 
>that all later Pythons know the mapping between tags and magic numbers. »
>
>The question is: why do we have to keep a mapping of past tags and magic
>numbers? Don't we only care about our current tag and magic number?
>(similarly, we don't know, and need to know, about Jython's or Pypy's
>stuff...).
>
>As far as I can tell, it would remove the burden of maintening an ever-growing
>registry of past magic numbers and tags.

If you look at the comment near the top of import.c, we kind of do anyway, we
just don't make it available to Python. ;)

I don't have strong feelings about this.  I thought it would be handy for
future Python's to have access to this, but then, without access to previous
version magic numbers, it probably doesn't help much.  And as you say, CPython
won't know about alternative implementation's tags.

So I'm willing to call YAGNI on it and just expose the current Python's magic
tag.  While we're at it, how about making both the tag and the number
attributes of the imp module, instead of functions like .get_magic()?  Of
course we'd keep the latter for backward compatibility.

-Barry

Attachment: signature.asc
Description: PGP signature

_______________________________________________
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

Reply via email to