[Python-Dev] Re: PEP 326: A Case for All

Gerrit Holl gerrit at nl.linux.org
Mon Jan 5 05:55:37 EST 2004


Josiah Carlson wrote:
> Terry also suggested that the attributes be cmp.hi and cmp.lo, which
> seem to be obvious attribute names for what they are.  String
> representations for them are certainly up for debate, ObjHi/ObjLo,
> NoneHi/NoneLo, Highest/Lowest, Infinity/NegativeInfinity were offered.
> My only concern is that eval(repr(cmp.hi)) == cmp.hi and
> eval(repr(cmp.lo)) == cmp.lo be true, but I am leaning toward
> Highest/Lowest or hi/lo.

What about: repr(cmp.lo) == "cmp.lo", etc.?
hi and lo would be instances of a certain class (cmp.extreme?). How
exactly the __repr__ of this class would know the name of cmp I don't
know. What do we do with cmp.extreme - or cmp.hi.__class__ - is it
allowed to make additional instances, as with bool, or not, as with
NoneType? I propose the latter, because of TOOWTDI, and we can be
certain that they are cmp attributes and cmp is always available (IIRC
shadowing builtins will become forbidden evantually?), so it's got less
problems.

> The names Infinity and NegativeInfinity seem to suggest numbers. 

I don't think so. IIRC, Infinity is not a number...

> Numbers can have math done on them.

...because you can't do math on them.

I propose:

cmp.high.__class__ == cmp.low.__class__ == cmp.extreme

yours,
Gerrit.

-- 
180. If a father give a present to his daughter -- either marriageable
or a prostitute (unmarriageable) -- and then die, then she is to receive a
portion as a child from the paternal estate, and enjoy its usufruct so
long as she lives. Her estate belongs to her brothers.
          -- 1780 BC, Hammurabi, Code of Law
-- 
Asperger's Syndrome - a personal approach:
	http://people.nl.linux.org/~gerrit/english/



More information about the Python-Dev mailing list