> > Is None so weird? All I am proposing is a symmetric value to None.
> > Just like there is a -1 and 1, -Infinity and Infinity, None logically
> > should have Some. Maybe not so much -Some == None, but as I propose in
> > the PEP, possibly Some == not None.
> None's purposr is not to be less than all numbers (in fact in
> the past it wasn't); it's to be "not any object", like nil or NULL in
> other languages.
> I don't see a similar broad role for Some.
> And I repeat my question: which other language has that concept?
> --Guido van Rossum (home page: http://www.python.org/~guido/)
Certainly if one thinks of None as an object, or a possible pointer to
an object, None does fit the role of nil or NULL. The fact is, NULL and
nil, as pointers, are 0. None does not equal 0, it is a symbolic
representation of the lack of any value (something I remember you saying
before, but cannot find a quote), who'se original purpose was to be an
equivalent to nil or NULL. As of right now, None has gone beyone its
original purpose. As soon as comparisons were able to be done to it and
reveal that None was smaller than anything else (even the floating point
-infinity), it seemingly has become a more consistant minimum value.
Some is just begging to be a more consistant maximum value. It is
bigger than sys.maxint, float(1e309), and reveals that the current state
What other language has the concept? Python already has the concept.
None is currently used as negative infinity in some projects, an actual
negative infinity, one that doesn't crap out on integers that cannot be
cast into floats. Some would become positive infinity.
In terms of non-Python languages, I don't know of any, but that doesn't
mean that they don't exist - it just means that I have limited knowledge
of programming languages (I only know about 7 or so).
[Josiah proposes a Some object to be the counterpart of None]
[Guido seems reluctant]
Josiah: I have a counterproposal. The good news is, it's REALLY easy -- you
won't need a PEP, and I am sure that you'll get no objections from anyone
on this list. And it'll provide you with a "Some" object that acts like
you describe (except the one mention you made of "Some == not None"...
that one's a bad idea since right now "True == not None").
Here's the idea: Create a file called "Some.py":
-------- Some.py ------------
def __lt__(self, other):
return False # never less than anything
def __le__(self, other):
if other is Some:
return True # equal to itself
return False # less than anything else
def __gt__(self, other):
if other is Some:
return False # equal to itself
return True # greater than anything else
def __ge__(self, other):
return True # greater than or equal to anything
Some = _SomeType() # singleton instance
---------- end --------------
Place this in your python path, then add this line to the top of your
"from Some import Some".
If you really want to, you could put code in your site.py file so
that you don't even need this import line, but I think in the long
run you'll prefer using the import line.
I think that this meets your expectations (if I understood them
properly), and if not, it can probably be adjusted so that it does.
The one thing it doesn't do is that it isn't part of the Standard
Library. But that doesn't mean it can't be part of YOUR standard
library... something you use all the time all over the place. I
think that most people on this list (myself included) would say
that the uses of this object are sufficiently esoteric and the
naming of it is sufficiently quirky that they wouldn't want it in
the language itself, but *everyone* here would stand up for your
right to create and use such an object yourself... something which
would never be possible in (for instance) Java.
Once-we've-got-Some-perhaps-we-should-consider-a-builtin-Milk lly yours,
-- Michael Chermside
Fresh cvs up (no local changes) on Mac OS X 10.2.8 yields this while running
test_codeccallbacks (non-framework build, configured only using
malloc: protecting edges
malloc: recording stacks using standard recorder
malloc: enabling scribbling to detect mods to free blocks
malloc: checks heap after 1th operation and each 1000 operations
malloc: environment variables that can be set for debug:
- MallocGuardEdges to add 2 guard pages for each large block
- MallocDoNotProtectPrelude to disable protection (when previous flag set)
- MallocDoNotProtectPostlude to disable protection (when previous flag set)
- MallocStackLogging to record all stacks. Tools like leaks can then be applied
- MallocStackLoggingNoCompact to record all stacks. Needed for malloc_history
- MallocScribble to detect writing on free blocks: 0x55 is written upon free
- MallocCheckHeapStart <n> to check the heap from time to time after <n> operations
- MallocHelp - this help!
MallocCheckHeap: PASSED check at 1th operation
MallocCheckHeap: PASSED check at 1001th operation
MallocCheckHeap: PASSED check at 2001th operation
MallocCheckHeap: PASSED check at 3001th operation
test_backslashescape (__main__.CodecCallbackTest) ... ok
test_badandgoodbackslashreplaceexceptions (__main__.CodecCallbackTest) ... ok
test_badandgoodignoreexceptions (__main__.CodecCallbackTest) ... ok
test_badandgoodreplaceexceptions (__main__.CodecCallbackTest) ... ok
test_badandgoodstrictexceptions (__main__.CodecCallbackTest) ... ok
test_badandgoodxmlcharrefreplaceexceptions (__main__.CodecCallbackTest) ... ok
test_badhandlerresults (__main__.CodecCallbackTest) ... ok
test_badregistercall (__main__.CodecCallbackTest) ... ok
test_bug828737 (__main__.CodecCallbackTest) ... ok
test_callbacks (__main__.CodecCallbackTest) ... ok
test_charmapencode (__main__.CodecCallbackTest) ... ok
test_decodehelper (__main__.CodecCallbackTest) ... ok
MallocCheckHeap: PASSED check at 4001th operation
test_encodehelper (__main__.CodecCallbackTest) ... ok
Debug memory block at address p=0x7cb138:
7032 bytes originally requested
The 4 pad bytes at p-4 are FORBIDDENBYTE, as expected.
The 4 pad bytes at tail=0x7cccb0 are not all FORBIDDENBYTE (0xfb):
at tail+0: 0x33 *** OUCH
at tail+1: 0x35 *** OUCH
at tail+2: 0x34 *** OUCH
at tail+3: 0x3b *** OUCH
The block was made by call #639840562 to debug malloc/realloc.
Data at p: 00 00 00 00 00 00 00 00 ... 33 35 34 3b 26 23 31 32
Fatal Python error: bad trailing pad byte
The "Data at p" hex bytes map to ['3', '5', '4', ';', '&', '#', '1', '2'].
The Malloc messages are all from Apple's malloc() pkg with a bunch of debug
environment variables set.
I haven't dug into this any further. I applied a new OS X security update
yesterday. That's the only recent change to the system I'm aware of. GCC
[GCC 3.3 20030304 (Apple Computer, Inc. build 1493)] on darwin
as reported by the Python interpreter at startup.
Anyone else seen this?
John J Lee wrote:
> I can see that people not knowing how to spell "hierarchy" might be a
> problem here <wink>
Heh, good point. I always get confused by the place of the 'heir' in the
'hierarchy'. I had a seriously hard time coming up with a one word name
that suggested the right semantics for that category. If the idea gets
any interest, it'd be nice to find a better word for that case. I was
tempted to use __ambiguous__, though :)
Hmm, __scan__ could be an option. The other two are fairly specific
about where to look, but category 'C' requests a scan of the package
A: from __absolute__.dotted.name import foo
B: from __relative__.dotted.name import bar
C: from __scan__.dotted.name import foobar
D: from dotted.name import barfoo
I suspect the 'as' clause would be heavily used with this construct, but
it wouldn't be compulsory - as far as module referencing in the code
goes, I don't think there's anything illegal about the special names.
Nick Coghlan | Brisbane, Australia
Email: ncoghlan(a)email.com | Mobile: +61 409 573 268
>>> fdrake(a)users.sourceforge.net wrote
> Update of /cvsroot/python/python/dist/src/Include
> In directory sc8-pr-cvs1:/tmp/cvs-serv22509
> Modified Files:
> Tag: release23-maint
> Log Message:
> Post-release version bumpage.
Argh! Nonononononono! Please leave the branch at 2.3.3 for Jack to cut
the Mac versions!
Anthony Baxter <anthony(a)interlink.com.au>
It's never too late to have a happy childhood.
I would like to add an section to the Library Reference to fulfill
license requirements for code included in Python.
For example, the license for underlying the Mersenne Twister code is
already embedded in the source but it requests to be included in the
docs as well.
Any thoughts or objections?
On behalf of the Python development team and the Python community, I'm
happy to announce the release of Python 2.3.3 (final).
Python 2.3.3 is a bug-fix release of Python 2.3. A couple of serious
bugs related to weakrefs and the cyclic garbage collector have been
fixed, along with a number of bugs in the standard library. See the
release notes on the web page for more details.
For more information on Python 2.3.3, including download links for
various platforms, release notes, and known issues, please see
Highlights of this new release include:
- A couple of serious bugs in the interactions of weakrefs and
cyclic GC have been squashed.
- At shutdown, the second call to the cyclic garbage collector has
been removed. This caused more problems than it solved.
- The xml.parsers.expat module now provides Expat 1.95.7.
- Bug #823328: urllib2's HTTP Digest Auth support works again.
- See http://www.python.org/2.3.3/NEWS.html for other bugfixes.
Highlights of the previous major Python release (2.3) are available
from the Python 2.3 page, at
Enjoy the new release,
Python 2.3.x Release Manager
(on behalf of the entire python-dev team)
Hi Python-announce-list-request ,
I have a picture online now. I just want someone to know me before they
see me. I just feel better that way. (but believe me you wont be
disappointed) Well i am 22 years old. I have a very out going personality. I
love to meet new people, i am on the varsity cheerleading squad. I like
the little romantic stuff and love to be swept off my feet and
suprised. I am currently looking for a relationship. All around if i were to
use 3 words to describe me id say Outgoing, sexy, and spontaneous :) And
if u wanna chat or get to know me. If u really like what u see. youll
do more than just send me a note.
Talk to you soon I hope... :)
ps. my friend Maria is on with me as well.
I do not wish to go on any blind dates at all, now or in the future: