Re: [Python-Dev] adding _Py prefix to names in 2.5.1?

2007-01-18 Thread Raghuram Devarakonda
On 1/18/07, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > Neal Norwitz schrieb: > > http://python.org/sf/1637022 points out a problem caused by the lack > > of a _Py prefix on Ellipsis. Most (all?) of the new AST names are not > > prefixed. These are all meant to be internal names. Are there an

Re: [Python-Dev] Problem between deallocation of modules and func_globals

2007-01-18 Thread Martin v. Löwis
Josiah Carlson schrieb: > Seems to me like a bug, but the bug could be fixed if the module's > dictionary kept a (circular) reference to the module object. Who else > has been waiting for a __module__ attribute? This is the time machine at work: py> import encodings py> encodings.search_function

Re: [Python-Dev] Problem between deallocation of modules and func_globals

2007-01-18 Thread Martin v. Löwis
Brett Cannon schrieb: > Anybody have any ideas on how to deal with this short of rewriting > some codecs stuff so that they don't depend on global state in the > module or just telling me to just live with it? There is an old patch by Armin Rigo ( python.org/sf/812369 ), which attempts to implemen

Re: [Python-Dev] Deletion order when leaving a scope?

2007-01-18 Thread Martin v. Löwis
Larry Hastings schrieb: > I just ran a quickie experiment and determined: when leaving a scope, > variables are deleted FIFO, aka in the same order they were created. Your experiment was apparently incomplete: Variables are *not* deleted in the same order in which they are created: py> class A:

Re: [Python-Dev] adding _Py prefix to names in 2.5.1?

2007-01-18 Thread Martin v. Löwis
Neal Norwitz schrieb: > http://python.org/sf/1637022 points out a problem caused by the lack > of a _Py prefix on Ellipsis. Most (all?) of the new AST names are not > prefixed. These are all meant to be internal names. Are there any > issues with changing this? If we do so, it means that any mo

Re: [Python-Dev] Problem between deallocation of modules and func_globals

2007-01-18 Thread Josiah Carlson
"Brett Cannon" <[EMAIL PROTECTED]> wrote: > I have discovered an issue relating to func_globals for functions and > the deallocation of the module it is contained within. Let's say you > store a reference to the function encodings.search_function from the > 'encodings' module (this came up in C c

[Python-Dev] Problem between deallocation of modules and func_globals

2007-01-18 Thread Brett Cannon
I have discovered an issue relating to func_globals for functions and the deallocation of the module it is contained within. Let's say you store a reference to the function encodings.search_function from the 'encodings' module (this came up in C code, but I don't see why it couldn't happen in Pyth

Re: [Python-Dev] buglet in long("123\0", 10)

2007-01-18 Thread Calvin Spealman
On 1/18/07, Nick Coghlan <[EMAIL PROTECTED]> wrote: > Calvin Spealman wrote: > > Added a check in test_long.LongTest.test_misc() that long("123\0", 10) > > fails properly and adapted the patch to int_new to long_new. I get > > this weird feeling that if its impossible for the function > > (PyLong_F

Re: [Python-Dev] Deletion order when leaving a scope?

2007-01-18 Thread Neil Toronto
Thomas Wouters wrote: > On 1/18/07, *Larry Hastings* <[EMAIL PROTECTED] > > wrote: > > > > I just ran a quickie experiment and determined: when leaving a > scope, variables are deleted FIFO, aka in the same order they were > created. This surprised me; I'd ex

Re: [Python-Dev] Testers wanted: mailbox.py bugfix

2007-01-18 Thread A.M. Kuchling
On Wed, Jan 17, 2007 at 03:36:58PM -0600, Charles Cazabon wrote: > I can't speak for MMDF or Babyl, but it's a well-known requirement that all > programs on a system must use the same type of locking when mbox files are > used; the administrator picks his favourite (fcntl, dotlocking, whatever) and

Re: [Python-Dev] buglet in long("123\0", 10)

2007-01-18 Thread Nick Coghlan
Calvin Spealman wrote: > Added a check in test_long.LongTest.test_misc() that long("123\0", 10) > fails properly and adapted the patch to int_new to long_new. I get > this weird feeling that if its impossible for the function > (PyLong_FromString) to know if its being given bad data, having know >

Re: [Python-Dev] [Python-3000] dict.items as attributes [Was: The bytes type]

2007-01-18 Thread Nick Coghlan
Jim Jewett wrote: > On 1/17/07, Thomas Wouters <[EMAIL PROTECTED]> wrote: >> On 1/16/07, Jim Jewett <[EMAIL PROTECTED]> wrote: >>> Other than dict.items (and .keys and .values) returning a non-list, >>> are there any other cases where the Py3K idiom can't already be used >>> in (or at least backpor

Re: [Python-Dev] Deletion order when leaving a scope?

2007-01-18 Thread Thomas Wouters
On 1/18/07, Larry Hastings <[EMAIL PROTECTED]> wrote: I just ran a quickie experiment and determined: when leaving a scope, variables are deleted FIFO, aka in the same order they were created. This surprised me; I'd expected them to be deleted LIFO, aka last first. Why is it thus? Is this b