Re: [Python-Dev] Better module shutdown procedure

2009-10-15 Thread Antoine Pitrou
Le Wed, 14 Oct 2009 18:27:37 -0500, Daniel Stutzbach a écrit :
> 
> Here is my understanding of the proposed procedure:
> 
> 1. Replace modules in sys.modules with weakrefs 2. Run the garbage
> collector
> 3. Replace globals in any remaining modules with None 4. Run the garbage
> collector
> 
> Is it possible for a __del__ method to be called in step 4 or not?  I am
> still unclear on this point. :-)

If an object is holding a reference to a module (e.g. self._sys = sys), 
then yes it should be possible because the reference has been creating a 
cycle.


___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Python 2.6.4rc1

2009-10-15 Thread Jesse Noller
On Wed, Oct 7, 2009 at 2:09 PM, Barry Warsaw  wrote:
> On Oct 7, 2009, at 1:26 PM, Scott Dial wrote:
>
>> I suspect this release is primarily to quench the problems with
>> distutils, but..
>>
>> http://bugs.python.org/issue5949
>>
>> doesn't seem to have been addressed by you. And this seems like it would
>> be another unfortunate loss of an opportunity.
>
> I want us to be very careful about 2.6.4.  This isn't a normal bug fix
> release, it's specifically there to remove the brown paper bag of 2.6.3 from
> our heads.  So let's be conservative and fix this one in 2.6.5.
>
> -Barry
>

Here's another one barry:

http://bugs.python.org/issue7120

We should get this in - it's a regression I introduced awhile ago for
environments without the multiprocessing module using logging.

jesse
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] Can 3.1 still be built without complex?

2009-10-15 Thread skip
I notice that WITHOUT_COMPLEX still appears in Python.h and several .c files
but nowhere else in the 2.6, 2.7 or 3.1 source, most particularly not in
configure or pyconfig.h.in.  Are builds --without-complex still supported?
Has it been tested at any time in the recent past?

Skip
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Python 2.6.4rc1

2009-10-15 Thread Barry Warsaw

On Oct 15, 2009, at 9:05 AM, Jesse Noller wrote:


Here's another one barry:

http://bugs.python.org/issue7120

We should get this in - it's a regression I introduced awhile ago for
environments without the multiprocessing module using logging.


Was this a regression in 2.6.2 or 2.6.3?  I think it might not matter,  
but let me know and I'll decide.


-Barry



PGP.sig
Description: This is a digitally signed message part
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Can 3.1 still be built without complex?

2009-10-15 Thread Eric Smith

[email protected] wrote:

I notice that WITHOUT_COMPLEX still appears in Python.h and several .c files
but nowhere else in the 2.6, 2.7 or 3.1 source, most particularly not in
configure or pyconfig.h.in.  Are builds --without-complex still supported?
Has it been tested at any time in the recent past?


I haven't tested it, but I still see WITHOUT_COMPLEX in trunk and py3k 
branches. In py3k, it's referenced in:


./Include/Python.h
./Misc/HISTORY
./Objects/complexobject.c
./Objects/object.c
./Parser/tokenizer.c
./Python/ast.c
./Python/bltinmodule.c
./Python/getargs.c
./Python/marshal.c
./Python/modsupport.c

I checked complexobject.c, and it looks like it's used correctly there.

Eric.
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Python 2.6.4rc1

2009-10-15 Thread Jesse Noller
On Thu, Oct 15, 2009 at 9:40 AM, Barry Warsaw  wrote:
> On Oct 15, 2009, at 9:05 AM, Jesse Noller wrote:
>
>> Here's another one barry:
>>
>> http://bugs.python.org/issue7120
>>
>> We should get this in - it's a regression I introduced awhile ago for
>> environments without the multiprocessing module using logging.
>
> Was this a regression in 2.6.2 or 2.6.3?  I think it might not matter, but
> let me know and I'll decide.
>
> -Barry
>
>

My original commit was on 2009-01-18, you tagged 2.6.2 on Tue Apr 14
13:17:30 2009, so it went into 2.6.2.

The fix is minor, the bug affects things such as GAE which may use
logging, but not have multiprocessing available.

jesse
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Python 2.6.4rc1

2009-10-15 Thread Barry Warsaw

On Oct 15, 2009, at 10:00 AM, Jesse Noller wrote:

On Thu, Oct 15, 2009 at 9:40 AM, Barry Warsaw   
wrote:

On Oct 15, 2009, at 9:05 AM, Jesse Noller wrote:


Here's another one barry:

http://bugs.python.org/issue7120

We should get this in - it's a regression I introduced awhile ago  
for

environments without the multiprocessing module using logging.


Was this a regression in 2.6.2 or 2.6.3?  I think it might not  
matter, but

let me know and I'll decide.

-Barry




My original commit was on 2009-01-18, you tagged 2.6.2 on Tue Apr 14
13:17:30 2009, so it went into 2.6.2.

The fix is minor, the bug affects things such as GAE which may use
logging, but not have multiprocessing available.


Approved for 2.6.4rc2

-Barry



PGP.sig
Description: This is a digitally signed message part
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Can 3.1 still be built without complex?

2009-10-15 Thread skip

Eric> I haven't tested it, but I still see WITHOUT_COMPLEX in trunk and 
py3k 
Eric> branches. In py3k, it's referenced in:
...

Sure, but is it ever exercised?  A name like WITHOUT_COMPLEX suggests that
it should be flipped on/off by configure using --without-complex, but that
script doesn't know about it and it's not mentioned in pyconfig.h.in, where
the various --with-* flags work their magic.

Skip
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Can 3.1 still be built without complex?

2009-10-15 Thread Eric Smith

[email protected] wrote:
Eric> I haven't tested it, but I still see WITHOUT_COMPLEX in trunk and py3k 
Eric> branches. In py3k, it's referenced in:

...

Sure, but is it ever exercised?  A name like WITHOUT_COMPLEX suggests that
it should be flipped on/off by configure using --without-complex, but that
script doesn't know about it and it's not mentioned in pyconfig.h.in, where
the various --with-* flags work their magic.


Ah, I misunderstood. I thought you were asking "does setting 
WITHOUT_COMPLEX work?"


No idea about any configure option, sorry.

Eric.
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Can 3.1 still be built without complex?

2009-10-15 Thread Mark Dickinson
[I originally sent this reply to Skip instead of to the list;  apologies.]

On Thu, Oct 15, 2009 at 12:39 PM,   wrote:
> I notice that WITHOUT_COMPLEX still appears in Python.h and several .c files
> but nowhere else in the 2.6, 2.7 or 3.1 source, most particularly not in
> configure or pyconfig.h.in.  Are builds --without-complex still supported?
> Has it been tested at any time in the recent past?

Apparently not.  :)

I just tried the following with an svn checkout of trunk (r75433), on OS X 10.6:

dickinsm$ CC='gcc -DWITHOUT_COMPLEX' ./configure && make

The build fails with:

gcc -DWITHOUT_COMPLEX -c -fno-strict-aliasing -DNDEBUG -g  -O3 -Wall
-Wstrict-prototypes  -I. -IInclude -I./Include   -DPy_BUILD_CORE -o
Python/compile.o Python/compile.c
Python/compile.c: In function ‘compiler_add_o’:
Python/compile.c:914: error: ‘Py_complex’ undeclared (first use in
this function)
Python/compile.c:914: error: (Each undeclared identifier is reported only once
Python/compile.c:914: error: for each function it appears in.)
Python/compile.c:914: error: expected ‘;’ before ‘z’
Python/compile.c:931: warning: implicit declaration of function
‘PyComplex_Check’
Python/compile.c:937: error: ‘z’ undeclared (first use in this function)
Python/compile.c:937: warning: implicit declaration of function
‘PyComplex_AsCComplex’
make: *** [Python/compile.o] Error 1

Mark

Postscript:  the above compilation failure is easily fixed.  The next
failure is:

gcc -DWITHOUT_COMPLEX  -u _PyMac_Error -o python.exe \
Modules/python.o \
libpython2.7.a -ldl
Undefined symbols:
  "_PyComplex_RealAsDouble", referenced from:
  __PyComplex_FormatAdvanced in libpython2.7.a(formatter_string.o)
  "_PyComplex_ImagAsDouble", referenced from:
  __PyComplex_FormatAdvanced in libpython2.7.a(formatter_string.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [python.exe] Error 1
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Can 3.1 still be built without complex?

2009-10-15 Thread Antoine Pitrou
 pobox.com> writes:
> 
> I notice that WITHOUT_COMPLEX still appears in Python.h and several .c files
> but nowhere else in the 2.6, 2.7 or 3.1 source, most particularly not in
> configure or pyconfig.h.in.  Are builds --without-complex still supported?
> Has it been tested at any time in the recent past?

Is there any point in building without complex? Size reduction perhaps?
If nobody uses it, we could remove that option. We have trouble staying
compatible with lots of build options (see how --without-threads is little
exercised).

Regards

Antoine.


___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Can 3.1 still be built without complex?

2009-10-15 Thread Fred Drake
On Thu, Oct 15, 2009 at 11:06 AM, Antoine Pitrou  wrote:
> We have trouble staying
> compatible with lots of build options (see how --without-threads is little
> exercised).

I don't know if folks deploying on embedded platforms are using these
options (directly or indirectly), but expect that's the primary
audience.

Hopefully somebody who's doing that can tell us if they're using the
defines, and what versions of Python they're currently using.  Then we
can determine whether the should be supported.

If they should be, there should be buildbot's set up for relevant
configurations.  Otherwise removal is best.


  -Fred

-- 
Fred L. Drake, Jr.
"Chaos is the score upon which reality is written." --Henry Miller
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Python 2.6.4rc1

2009-10-15 Thread Guido van Rossum
Thanks all!

On Thu, Oct 15, 2009 at 7:14 AM, Barry Warsaw  wrote:
> On Oct 15, 2009, at 10:00 AM, Jesse Noller wrote:
>
>> On Thu, Oct 15, 2009 at 9:40 AM, Barry Warsaw  wrote:
>>>
>>> On Oct 15, 2009, at 9:05 AM, Jesse Noller wrote:
>>>
 Here's another one barry:

 http://bugs.python.org/issue7120

 We should get this in - it's a regression I introduced awhile ago for
 environments without the multiprocessing module using logging.
>>>
>>> Was this a regression in 2.6.2 or 2.6.3?  I think it might not matter,
>>> but
>>> let me know and I'll decide.
>>>
>>> -Barry
>>>
>>>
>>
>> My original commit was on 2009-01-18, you tagged 2.6.2 on Tue Apr 14
>> 13:17:30 2009, so it went into 2.6.2.
>>
>> The fix is minor, the bug affects things such as GAE which may use
>> logging, but not have multiprocessing available.
>
> Approved for 2.6.4rc2
>
> -Barry
>
>
> ___
> Python-Dev mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe:
> http://mail.python.org/mailman/options/python-dev/guido%40python.org
>
>



-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Can 3.1 still be built without complex?

2009-10-15 Thread Mark Dickinson
On Thu, Oct 15, 2009 at 4:06 PM, Antoine Pitrou  wrote:
>  pobox.com> writes:
>>
>> I notice that WITHOUT_COMPLEX still appears in Python.h and several .c files
>> but nowhere else in the 2.6, 2.7 or 3.1 source, most particularly not in
>> configure or pyconfig.h.in.  Are builds --without-complex still supported?
>> Has it been tested at any time in the recent past?
>
> Is there any point in building without complex? Size reduction perhaps?
> If nobody uses it, we could remove that option. We have trouble staying
> compatible with lots of build options (see how --without-threads is little
> exercised).

Size reduction is the only point I can think of.

There's one respect in which complex is slightly more tightly
integrated in py3k than in trunk:  raising a negative number to a
non-integer power (e.g., (-1)**0.5) gives a complex result in py3k.

In trunk this raises ValueError, which means that the only way to
get a complex number in trunk is if you explicitly ask for one
somehow (e.g., by invoking complex, or using the cmath module,
or using imaginary literals, ...), so it makes slightly more sense
to build without the complex type there.

+1 for removing the WITHOUT_COMPLEX define from py3k.
-0 for removing it from trunk.

Mark
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Can 3.1 still be built without complex?

2009-10-15 Thread Antoine Pitrou
Mark Dickinson  gmail.com> writes:
> 
> There's one respect in which complex is slightly more tightly
> integrated in py3k than in trunk:  raising a negative number to a
> non-integer power (e.g., (-1)**0.5) gives a complex result in py3k.

>>> (-1)**.5
(6.123031769111886e-17+1j)

Don't we have a precision problem here? 0.5 is supposed to be represented
exactly, isn't it?



___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Can 3.1 still be built without complex?

2009-10-15 Thread Mark Dickinson
On Thu, Oct 15, 2009 at 8:17 PM, Antoine Pitrou  wrote:
 (-1)**.5
> (6.123031769111886e-17+1j)
>
> Don't we have a precision problem here? 0.5 is supposed to be represented
> exactly, isn't it?

0.5 is represented exactly, but complex.__pow__ makes no pretence of
being correctly rounded (and making it correctly rounded would likely
be prohibitively expensive in terms of code size and complexity).  It's
using something like x**y = exp(y*log(x)) behind the scenes, at least
for computing the argument of the result.

For square roots, cmath.sqrt produces better results.

Mark
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Can 3.1 still be built without complex?

2009-10-15 Thread Skip Montanaro
http://bugs.python.org/issue7147

Passes test (no big surprise there).  Doesn't yet include any changes
to documentation
or Misc/NEWS entry.  Should this be decided I will take a look at that.

Skip
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Better module shutdown procedure

2009-10-15 Thread Neil Schemenauer
On Wed, Oct 14, 2009 at 02:16:35PM -0600, Neil Schemenauer wrote:
> The procedure implemented by http://bugs.python.org/issue812369
> seems to be a better idea.

After some experimentation I realize this idea is not ready yet.
The main problem comes from references to Python objects that
modules keep but don't expose to the garbage collector. For example,
gcmodule.c has a static pointer "tmod" that is a reference to the
"time" module. This reference prevents the "time" module from being
freed during interpreter shutdown.

Ideally, I suppose modules should be treated like any other object
and have tp_traverse and tp_clear methods that deal with these sorts
of pointers. They would have to delegated to the instance since each
module would have its own implementation.

  Neil
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com