[Python-ideas] Reviving PEP 3140 - "str(container) should call str(item), not repr(item)"

Mark Janssen dreamingforward at gmail.com
Sun Apr 7 02:09:42 CEST 2013


>> This is a problem with "everything is an object" model:  no
>> recognition is made between a distinction that is very high up the
>> "object taxonomy":  container vs. atomic elements.
>
> Python does not have non-object atomic data elements.

Yeah.  I think this is where we made a mistake -- we went too far into
"purity" and away from Tim's Zen wisdom of "practicality".  We don't
need ints as objects.  Once Python did this (Python 2.6?), we had to
gain an obscure system of __new__ in addition to __init__, and the
nice clean conceptual model got obfuscated.  (Why do some objects need
it and others don't?)  The only nice thing about it is big-nums and
the complete abstraction that python provides of it, but I believe,
now, that it's a premature optimization.

The only reason we do it is to make the very nice illusion of
arbitrarily large arithmetic.  But in practice, this is only used to
impress others, not for much real programming.  Frankly, I have to
admit that longs did just fine, with their automatic conversion from
ints when things got too big.

Let's update the OOP paradigm and accept we can't *totally* get away
from the machine and differentiate between atomic types like integers
and let containers be the "first" Object.

MarkJ
Tacoma, Washington



More information about the Python-ideas mailing list