[Python-Dev] int/long FutureWarning

Martin v. L÷wis martin@v.loewis.de
Fri, 29 Nov 2002 16:41:28 +0100


> Someone will have to give me a hand with this: I could probably figure
> out how normal future imports work (although I've never done one),
> but this  is one of those hairy ones that needs a hook in the parser.
> And that's an area  of Python that has always frightened me to no
end...

I think Guido's recommendation of looking at the yield processing is not
that helpful; yield is added as a keyword in the parser, whereas the
FutureWarning occurs in compile.c.

So you need to add the feature to compile.c:future_check_features, and
then just check for the flag around the place where the FutureWarning is
raised (and interpret the constant as long if the feature is set).

> Another option was to add "k1", "k2", "k4" and "k8", to mean
> uint8,  uint16, uint32 and uint64. "k1" and "k2" would be synonyms
> for "B" and "H", but this would make the k-format-family consistent.

Since this is the proposal that MAL just came up with also, it seems to
be a manifest idea (unless it was also MAL who proposed this the last
time around, in which case it might only be manifest to him). If that
meets all requirements, go for it - I'm just not sure how I would use
for plain int, since I don't know its size in advance.

Regards,
Martin
--
- Jack Jansen        <Jack.Jansen@oratrix.com>
http://www.cwi.nl/~jack -
- If I can't dance I don't want to be part of your revolution -- Emma
Goldman -


_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev