Re: [Python-Dev] patching asyncore and asynchat

2007-12-11 Thread Daniel Arbuckle
> From: "Giampaolo Rodola'" <[EMAIL PROTECTED]>
> I remembered right now that there's a patch pending which should be
> included in the trunk before solving issues related to py3k and/or
> applying other changes:
> http://bugs.python.org/issue1736190
> Since it solves a lot of older and newer asyncore/chat issues I guess
> you should work on that one instead of using the current asyncore/chat
> versions available in the trunk.

Those patches can't be applied directly to the py3k branch, where
Guido asked me to work, so instead I've ported them and merged them
with my patch where appropriate. This merged patch should address both
py3k porting and the issues in raised in 1736190

http://bugs.python.org/issue1563
___
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] builtin_format function code-spacing in bltinmodule.c

2007-12-11 Thread Joseph Armbruster
All,

Not sure if this is significant or not but the spacing of the builtin_format
function is not consistent with the
rest of the bltinmodule.c file.

Joseph Armbruster
___
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] builtin_format function code-spacing in bltinmodule.c

2007-12-11 Thread Guido van Rossum
It is important; care to submit a fix?

On Dec 11, 2007 11:08 AM, Joseph Armbruster <[EMAIL PROTECTED]> wrote:
> All,
>
> Not sure if this is significant or not but the spacing of the builtin_format
> function is not consistent with the
> rest of the bltinmodule.c file.

-- 
--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] Signals+Threads (PyGTK waking up 10x/sec).

2007-12-11 Thread Jan Claeys
Op vrijdag 07-12-2007 om 07:26 uur [tijdzone -0700], schreef Sean
Reifschneider:
> I would say that this is an optimization that helps a specific set of
> platforms, including one that I think we really care about, the OLPC
> which needs it for decreased battery use.

Almost every laptop user would benefit from it, and even some desktop or
server users might save on their electric power bill...


-- 
Jan Claeys

___
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] Signals+Threads (PyGTK waking up 10x/sec).

2007-12-11 Thread Guido van Rossum
On Dec 11, 2007 4:54 PM, Jan Claeys <[EMAIL PROTECTED]> wrote:
> Op vrijdag 07-12-2007 om 07:26 uur [tijdzone -0700], schreef Sean
> Reifschneider:
> > I would say that this is an optimization that helps a specific set of
> > platforms, including one that I think we really care about, the OLPC
> > which needs it for decreased battery use.
>
> Almost every laptop user would benefit from it, and even some desktop or
> server users might save on their electric power bill...

Do you have data to support this claim?

-- 
--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] Signals+Threads (PyGTK waking up 10x/sec).

2007-12-11 Thread Greg Ewing
Guido van Rossum wrote:

> On Dec 11, 2007 4:54 PM, Jan Claeys <[EMAIL PROTECTED]> wrote:
> 
>>Almost every laptop user would benefit from it, and even some desktop or
>>server users might save on their electric power bill...
> 
> 
> Do you have data to support this claim?

Even if it doesn't save any power, using CPU unnecessarily
is a bad thing for any application to do on a multitasking
system.

-- 
Greg Ewing, Computer Science Dept, +--+
University of Canterbury,  | Carpe post meridiem! |
Christchurch, New Zealand  | (I'm not a morning person.)  |
[EMAIL PROTECTED]  +--+
___
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] sliceobject Py_None step inquiry

2007-12-11 Thread Joseph Armbruster

I was playing around with sliceobject.c this evening and noticed the following 
behavior.  If you slice with a step 0, you receive a ValueError but when you 
slice with a step of None, the step is set to 1.  As an example, observe the 
following interactive session:

 >>> a = [1,2,3,4,5,6]
 >>> b = slice(0,5,None)
 >>> a[b]
[1, 2, 3, 4, 5]
 >>> b = slice(0,5,0)
 >>> a[b]
Traceback (most recent call last):
   File "", line 1, in 
ValueError: slice step cannot be zero
 >>>

Within the code, it looks like Py_None performs a step of 1.  Does it make 
sense to create a patch so that None and 0 behave the same in this respect?

 >>> a = [1,2,3,4,5,6]
 >>> b = slice(0,5,None)
 >>> a[b]
Traceback (most recent call last):
   File "", line 1, in 
ValueError: slice step cannot be None
 >>> b = slice(0,5,0)
 >>> a[b]
Traceback (most recent call last):
   File "", line 1, in 
ValueError: slice step cannot be zero
 >>> b = slice(0,5)
 >>> a[b]
[1, 2, 3, 4, 5]
 >>>


Joe
___
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] sliceobject Py_None step inquiry

2007-12-11 Thread Calvin Spealman
I think that should not change. None is different than 0. It makes  
sense to use it as a "use the default value" kind of place holder.  
Silently using 1 when you pass 0 is a very different thing.

Maybe the slice was calculated and the developer should know about it  
being 0, because in this case they really don't want a step of 1, or  
the calculation was broken. There are lots of reasons.

On Dec 11, 2007, at 9:23 PM, Joseph Armbruster wrote:

>
> I was playing around with sliceobject.c this evening and noticed  
> the following
> behavior.  If you slice with a step 0, you receive a ValueError but  
> when you
> slice with a step of None, the step is set to 1.  As an example,  
> observe the
> following interactive session:
>
 a = [1,2,3,4,5,6]
 b = slice(0,5,None)
 a[b]
> [1, 2, 3, 4, 5]
 b = slice(0,5,0)
 a[b]
> Traceback (most recent call last):
>File "", line 1, in 
> ValueError: slice step cannot be zero

>
> Within the code, it looks like Py_None performs a step of 1.  Does  
> it make
> sense to create a patch so that None and 0 behave the same in this  
> respect?
>
 a = [1,2,3,4,5,6]
 b = slice(0,5,None)
 a[b]
> Traceback (most recent call last):
>File "", line 1, in 
> ValueError: slice step cannot be None
 b = slice(0,5,0)
 a[b]
> Traceback (most recent call last):
>File "", line 1, in 
> ValueError: slice step cannot be zero
 b = slice(0,5)
 a[b]
> [1, 2, 3, 4, 5]

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

___
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] Signals+Threads (PyGTK waking up 10x/sec).

2007-12-11 Thread Guido van Rossum
On Dec 11, 2007 6:01 PM, Greg Ewing <[EMAIL PROTECTED]> wrote:
> Guido van Rossum wrote:
>
> > On Dec 11, 2007 4:54 PM, Jan Claeys <[EMAIL PROTECTED]> wrote:
> >
> >>Almost every laptop user would benefit from it, and even some desktop or
> >>server users might save on their electric power bill...
> >
> >
> > Do you have data to support this claim?
>
> Even if it doesn't save any power, using CPU unnecessarily
> is a bad thing for any application to do on a multitasking
> system.

Hm, Apple and Microsoft don't seem to think so. They go out of their
way to implement elaborate visual effects.

Again -- is there any data about the cost of PyGTK's waking up 10x/sec
on a typical laptop or server? (The XO is a special case because it
has very different power management abilities.)

-- 
--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] Signals+Threads (PyGTK waking up 10x/sec).

2007-12-11 Thread Andrew Bennetts
Guido van Rossum wrote:
> On Dec 11, 2007 4:54 PM, Jan Claeys <[EMAIL PROTECTED]> wrote:
> > Op vrijdag 07-12-2007 om 07:26 uur [tijdzone -0700], schreef Sean
> > Reifschneider:
> > > I would say that this is an optimization that helps a specific set of
> > > platforms, including one that I think we really care about, the OLPC
> > > which needs it for decreased battery use.
> >
> > Almost every laptop user would benefit from it, and even some desktop or
> > server users might save on their electric power bill...
> 
> Do you have data to support this claim?

http://www.lesswatts.org/projects/powertop/powertop.php

Some quotes plucked from that page:

“In the screenshot, the laptop isn't doing very well. Most of the time the
processor is in C2, and then only for an average of 4.4 milliseconds at a time.
If the laptop spent most of its time in C4 for at least 20 milliseconds, the
battery life would have been approximately one hour longer.”

“When running a full GNOME desktop, 3 wakeups per second is achievable.”

There's considerable effort being invested in the GNOME and Linux software stack
at the moment to get rid of unnecessary CPU wakeups, and people are reporting
significant improvements in laptop power consumption as a result of that work.

-Andrew.

___
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] Signals+Threads (PyGTK waking up 10x/sec).

2007-12-11 Thread Adam Olsen
On Dec 11, 2007 11:00 PM, Andrew Bennetts <[EMAIL PROTECTED]> wrote:
> Guido van Rossum wrote:
> > On Dec 11, 2007 4:54 PM, Jan Claeys <[EMAIL PROTECTED]> wrote:
> > > Op vrijdag 07-12-2007 om 07:26 uur [tijdzone -0700], schreef Sean
> > > Reifschneider:
> > > > I would say that this is an optimization that helps a specific set of
> > > > platforms, including one that I think we really care about, the OLPC
> > > > which needs it for decreased battery use.
> > >
> > > Almost every laptop user would benefit from it, and even some desktop or
> > > server users might save on their electric power bill...
> >
> > Do you have data to support this claim?
>
> http://www.lesswatts.org/projects/powertop/powertop.php
>
> Some quotes plucked from that page:
>
> "In the screenshot, the laptop isn't doing very well. Most of the time the
> processor is in C2, and then only for an average of 4.4 milliseconds at a 
> time.
> If the laptop spent most of its time in C4 for at least 20 milliseconds, the
> battery life would have been approximately one hour longer."
>
> "When running a full GNOME desktop, 3 wakeups per second is achievable."
>
> There's considerable effort being invested in the GNOME and Linux software 
> stack
> at the moment to get rid of unnecessary CPU wakeups, and people are reporting
> significant improvements in laptop power consumption as a result of that work.

There's a known issues page on there, on the bottom of which is
sealert, which used python, gtk, and threads.  It has since been
rewritten to not use threads, but it did exhibit the problem
set_wakeup_fd fixes (at least provides our half of the fix.)

https://bugzilla.redhat.com/show_bug.cgi?id=239893

-- 
Adam Olsen, aka Rhamphoryncus
___
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