[Python-Dev] PEP 3144 review. (original) (raw)

"Martin v. Löwis" martin at v.loewis.de
Mon Sep 28 23:29:42 CEST 2009


I would say that there certainly are precedents in other areas for keeping the information about the input form around. For example, occasionally it would be handy if parsing a hex integer returned an object that was compatible with other integers but somehow kept a hint that would cause printing it to use hex by default.

At the risk of bringing in false analogies: it seems that Python typically represents values of some type in their canonical form, rather than remembering the form in which they arrived in the program:

I guess a close case would be rational numbers: clearly, 3÷2 == 6÷4; would a Python library still remember (and repr) the original numerator and denominator?

Regards, Martin



More information about the Python-Dev mailing list