min and max id numbers

r.e.s. r.s at XXmindspring.com
Sat Dec 6 09:42:33 CET 2003


"Paul Rubin" wrote ...
> The id of an object in CPython is just its memory address.  Obviously
> you could not guarantee the HI object staying higher than all the
> other objects since the interpreter can always allocate more memory.
> To do what you're asking you'd have to modify the interpreter to have
> a new kind of sentinel object and have ident return special values for
> those objects.  I guess you could do that if you really wanted, but it
> would be a crazy crock.

Well, I only meant it as a "crazy crock" kind of game, but without 
modifying the interpreter.  Suppose Jane is allowed N keystrokes 
at Python's interactive window, then likewise for John, and none 
of their own code can be imported.  Say anyone making the machine
hang, or not come back to the prompt within 5 minutes, loses. The 
machine only has so much memory, so is it really obvious that John 
can always create an object HI-er than any of Jane's?  (Sorry if 
in my ignorance I'm imagining an altogether ridiculous scenario ;o)





More information about the Python-list mailing list