Re: [pyxl] xlrd 0.7.2 released!

2012-02-23 Thread Chris Withers
On 22/02/2012 23:17, Adrian Klaver wrote: I can see where that would be preferred when managing multiple versions of Python, but not when using a single version. Sorry, I don't agree. It is *never* a good idea to install packages globally. Using virtualenv or similar (buildout, etc) gives you

Re: storing in list and retrieving.

2012-02-23 Thread Smiley 4321
It requires concepts of 'python persistence' for the code to be designed . Else it simple. Looking for some flow?? On Thu, Feb 23, 2012 at 12:01 PM, Chris Angelico ros...@gmail.com wrote: On Thu, Feb 23, 2012 at 5:24 PM, Smiley 4321 ssmil...@gmail.com wrote: I need to write two file

Re: Questionnaire on motivation analysis of open source and open content

2012-02-23 Thread gene heskett
On Wednesday, February 22, 2012 03:14:51 PM George Tsinarakis did opine: Dear Sirs, We are researchers in Technical University of Crete and our current research is in the field of motivation analysis of open source and open content software projects participants. We would like to ask you to

Re: storing in list and retrieving.

2012-02-23 Thread Chris Angelico
On Thu, Feb 23, 2012 at 7:45 PM, Smiley 4321 ssmil...@gmail.com wrote: It requires concepts of 'python persistence' for the code to be designed . Else it simple. Looking for some flow?? Go through the tutorial on python.org if you haven't, get some code written, and then codify your

Reset static variables or a workaround

2012-02-23 Thread Nav
Hi Guys, I have a custom user form class, it inherits my own custom Form class: class UserForm(Form): first_name = TextField(attributes={id='id_firstname'}) Now, everytime UserForm() is instantiated it saves the attributes of each form members and passes it on to the new instance. I

Re: Reset static variables or a workaround

2012-02-23 Thread Chris Rebert
On Thu, Feb 23, 2012 at 1:26 AM, Nav navkir...@gmail.com wrote: Hi Guys, I have a custom user form class, it inherits my own custom Form class: class UserForm(Form):    first_name = TextField(attributes={id='id_firstname'}) Now, everytime UserForm() is instantiated it saves the attributes

Re: Reset static variables or a workaround

2012-02-23 Thread Jean-Michel Pichavant
Nav wrote: Hi Guys, I have a custom user form class, it inherits my own custom Form class: class UserForm(Form): first_name = TextField(attributes={id='id_firstname'}) Now, everytime UserForm() is instantiated it saves the attributes of each form members and passes it on to the new

Re: storing in list and retrieving.

2012-02-23 Thread Jean-Michel Pichavant
Smiley 4321 wrote: It requires concepts of 'python persistence' for the code to be designed . Else it simple. Looking for some flow?? Hi, Have a look at http://docs.python.org/library/pickle.html Cheers, JM -- http://mail.python.org/mailman/listinfo/python-list

[ANNOUNCE] pypiserver 0.5.1 - minimal pypi server

2012-02-23 Thread Ralf Schmitt
Hi, I've just uploaded pypiserver 0.5.1 to the python package index. pypiserver is a minimal PyPI compatible server. It can be used to serve a set of packages and eggs to easy_install or pip. pypiserver is easy to install (i.e. just easy_install pypiserver). It doesn't have any external

Re: asynchronous downloading

2012-02-23 Thread Mark Hammond
On 23/02/2012 5:58 PM, Plumo wrote: I want to download content asynchronously. This would be straightforward to do threaded or across processes, but difficult asynchronously so people seem to rely on external libraries (twisted / gevent / eventlet). Exactly - the fact it's difficult is why

Re: asynchronous downloading

2012-02-23 Thread Paul Rubin
Plumo richar...@gmail.com writes: What do you recommend? Threads. And why is there poor support for asynchronous execution? The freenode #python crowd seems to hate threads and prefer twisted, which seems to have the features you want and probably handles very large #'s of connections better

unexpected behaviour playing with dynamic methods

2012-02-23 Thread Marc Aymerich
Hi, I'm playing a bit with python dynamic methods and I came up with a scenario that I don't understant. Considering the follow code: # Declare a dummy class class A(object): pass # generate a dynamic method and insert it to A class for name in ['a', 'b', 'c']: if name == 'b':

Re: unexpected behaviour playing with dynamic methods

2012-02-23 Thread Peter Otten
Marc Aymerich wrote: Hi, I'm playing a bit with python dynamic methods and I came up with a scenario that I don't understant. Considering the follow code: # Declare a dummy class class A(object): pass # generate a dynamic method and insert it to A class for name in ['a', 'b',

Re: unexpected behaviour playing with dynamic methods

2012-02-23 Thread Marc Aymerich
On Feb 23, 2:05 pm, Peter Otten __pete...@web.de wrote: Marc Aymerich wrote: Hi, I'm playing a bit with python dynamic methods and I came up with a scenario that I don't understant. Considering the follow code: # Declare a dummy class class A(object):     pass # generate a

Re: asynchronous downloading

2012-02-23 Thread Richard Baron Penman
I want to download content asynchronously. This would be straightforward to do threaded or across processes, but difficult asynchronously so people seem to rely on external libraries (twisted / gevent / eventlet). Exactly - the fact it's difficult is why those tools compete. It is

distutils bdist_wininst failure on Linux

2012-02-23 Thread Steven D'Aprano
Following instructions here: http://docs.python.org/py3k/distutils/builtdist.html#creating-windows-installers I am trying to create a Windows installer for a pure-module distribution using Python 3.2. I get a LookupError: unknown encoding: mbcs Here is the full output of distutils and the

What does exc_info do in a logging call?

2012-02-23 Thread Roy Smith
In http://docs.python.org/release/2.6.7/library/logging.html, it says: logging.debug(msg[, *args[, **kwargs]]) [...] There are two keyword arguments in kwargs which are inspected: exc_info which, if it does not evaluate as false, causes exception information to be added to the logging message.

Re: [pyxl] xlrd 0.7.2 released!

2012-02-23 Thread xlstime
Hi, i want to learn pyxl please help me... kindly send useful information about pyxl *Thank you in Advance* XLS S :) On Thu, Feb 23, 2012 at 4:45 AM, python-ex...@raf.org wrote: Chris Withers wrote: On 22/02/2012 00:37, python-ex...@raf.org wrote: was good for previous versions. two

Re: What does exc_info do in a logging call?

2012-02-23 Thread Peter Otten
Roy Smith wrote: In http://docs.python.org/release/2.6.7/library/logging.html, it says: logging.debug(msg[, *args[, **kwargs]]) [...] There are two keyword arguments in kwargs which are inspected: exc_info which, if it does not evaluate as false, causes exception information to be added

Re: distutils bdist_wininst failure on Linux

2012-02-23 Thread jmfauth
On 23 fév, 15:06, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: Following instructions here: http://docs.python.org/py3k/distutils/builtdist.html#creating-windows... I am trying to create a Windows installer for a pure-module distribution using Python 3.2. I get a LookupError:

Re: What does exc_info do in a logging call?

2012-02-23 Thread Roy Smith
Duh, I figured out what's going on. I'm using a custom Formatter class, which overrides format(). It's the job of format() to handle this, and ours doesn't! -- http://mail.python.org/mailman/listinfo/python-list

Re: Should I acquire lock for logging.Handler.flush()?

2012-02-23 Thread Vinay Sajip
On Feb 22, 4:44 am, Fayaz Yusuf Khan fayaz.yusuf.k...@gmail.com wrote: Anyway, I read the source and found many interesting things that ought to be mentioned in the docs. Such as flush() should be called from close() whenever it's implemented. (FileHandler.close() is doing it) This is

Re: [pyxl] xlrd 0.7.2 released!

2012-02-23 Thread Chris Withers
On 23/02/2012 14:40, xlstime wrote: Hi, i want to learn pyxl please help me... kindly send useful information about pyxl I would suggest: - using your real name when posting - reading the tutorial at http://www.python-excel.org/ cheers, Chris -- Simplistix - Content Management, Batch

Re: asynchronous downloading

2012-02-23 Thread Giampaolo Rodolà
Il 23 febbraio 2012 07:58, Plumo richar...@gmail.com ha scritto: I want to download content asynchronously. This would be straightforward to do threaded or across processes, but difficult asynchronously so people seem to rely on external libraries (twisted / gevent / eventlet). (I would use

Re: Should I acquire lock for logging.Handler.flush()?

2012-02-23 Thread Fayaz Yusuf Khan
On Thursday 23 Feb 2012 8:23:42 AM Vinay Sajip wrote: If locking is required in a particular handler class for close or flush, that can be implemented by the developer of that handler class. AFAIK there is no such need for the handler classes in the stdlib - if you have reason to believe

multiprocessing, what am I doing wrong?

2012-02-23 Thread Eric Frederich
Below is some pretty simple code and the resulting output. Sometimes the code runs through but sometimes it just freezes for no apparent reason. The output pasted is where it just got frozen on me. It called start() on the 2nd worker but the 2nd worker never seemed to enter the run method.

Re: Should I acquire lock for logging.Handler.flush()?

2012-02-23 Thread Vinay Sajip
On Feb 23, 5:55 pm, Fayaz Yusuf Khan fayaz.yusuf.k...@gmail.com wrote: Well, as emit() is always being called from within a lock, I assumed that flush() should/would also be handled similarly. Afterall, they are handling the same underlying output stream or in case of the BufferingHandler

Just curious: why is /usr/bin/python not a symlink?

2012-02-23 Thread HoneyMonster
$ cd /usr/bin $ ls -l python* -rwxr-xr-x 2 root root 9496 Oct 27 02:42 python lrwxrwxrwx 1 root root6 Oct 29 19:34 python2 - python -rwxr-xr-x 2 root root 9496 Oct 27 02:42 python2.7 $ diff -s python python2.7 Files python and python2.7 are identical $ I'm just curious: Why two identical

Re: Just curious: why is /usr/bin/python not a symlink?

2012-02-23 Thread Colin Higwell
On Thu, 23 Feb 2012 19:11:16 +, HoneyMonster wrote: (reformatted (I hope) $ cd /usr/bin $ ls -l python* -rwxr-xr-x 2 root root 9496 Oct 27 02:42 python lrwxrwxrwx 1 root root 6 Oct 29 19:34 python2 - python -rwxr-xr-x 2 root root 9496 Oct 27 02:42 python2.7 $ diff -s python python2.7

Re: Just curious: why is /usr/bin/python not a symlink?

2012-02-23 Thread Jerry Hill
On Thu, Feb 23, 2012 at 2:11 PM, HoneyMonster someone@someplace.invalid wrote: $ cd /usr/bin $ ls -l python* -rwxr-xr-x 2 root root 9496 Oct 27 02:42 python lrwxrwxrwx 1 root root    6 Oct 29 19:34 python2 - python -rwxr-xr-x 2 root root 9496 Oct 27 02:42 python2.7 $ diff -s  python

Re: Just curious: why is /usr/bin/python not a symlink?

2012-02-23 Thread Chris Rebert
On Thu, Feb 23, 2012 at 11:11 AM, Colin Higwell someone@someplace.invalid wrote: $ cd /usr/bin $ ls -l python* -rwxr-xr-x 2 root root 9496 Oct 27 02:42 python lrwxrwxrwx 1 root root    6 Oct 29 19:34 python2 - python -rwxr-xr-x 2 root root 9496 Oct 27 02:42 python2.7 $ diff -s  python

Re: Just curious: why is /usr/bin/python not a symlink?

2012-02-23 Thread HoneyMonster
On Thu, 23 Feb 2012 14:24:23 -0500, Jerry Hill wrote: On Thu, Feb 23, 2012 at 2:11 PM, HoneyMonster someone@someplace.invalid wrote: $ cd /usr/bin $ ls -l python* -rwxr-xr-x 2 root root 9496 Oct 27 02:42 python lrwxrwxrwx 1 root root    6 Oct 29 19:34 python2 - python -rwxr-xr-x 2 root root

Re: Should I acquire lock for logging.Handler.flush()?

2012-02-23 Thread Vinay Sajip
On Feb 23, 5:55 pm, Fayaz Yusuf Khan fayaz.yusuf.k...@gmail.com wrote: buffer. Shouldn't the access be synchronized? I've now updated the repos for 2.7, 3.2 and default to add locking for flush/close operations. Thanks for the suggestion. Regards, Vinay Sajip --

Re: multiprocessing, what am I doing wrong?

2012-02-23 Thread MRAB
On 23/02/2012 17:59, Eric Frederich wrote: Below is some pretty simple code and the resulting output. Sometimes the code runs through but sometimes it just freezes for no apparent reason. The output pasted is where it just got frozen on me. It called start() on the 2nd worker but the 2nd worker

Re: Just curious: why is /usr/bin/python not a symlink?

2012-02-23 Thread Terry Reedy
On 2/23/2012 2:34 PM, HoneyMonster wrote: On Thu, 23 Feb 2012 14:24:23 -0500, Jerry Hill wrote: On Thu, Feb 23, 2012 at 2:11 PM, HoneyMonster someone@someplace.invalid wrote: $ cd /usr/bin $ ls -l python* -rwxr-xr-x 2 root root 9496 Oct 27 02:42 python lrwxrwxrwx 1 root root 6 Oct 29

sum() requires number, not simply __add__

2012-02-23 Thread Buck Golemon
I feel like the design of sum() is inconsistent with other language features of python. Often python doesn't require a specific type, only that the type implement certain methods. Given a class that implements __add__ why should sum() not be able to operate on that class? We can fix this in a

Re: sum() requires number, not simply __add__

2012-02-23 Thread Buck Golemon
On Feb 23, 1:19 pm, Buck Golemon b...@yelp.com wrote: I feel like the design of sum() is inconsistent with other language features of python. Often python doesn't require a specific type, only that the type implement certain methods. Given a class that implements __add__ why should sum() not

Re: sum() requires number, not simply __add__

2012-02-23 Thread Arnaud Delobelle
On 23 February 2012 21:19, Buck Golemon b...@yelp.com wrote: I feel like the design of sum() is inconsistent with other language features of python. Often python doesn't require a specific type, only that the type implement certain methods. Given a class that implements __add__ why should

Re: sum() requires number, not simply __add__

2012-02-23 Thread Chris Rebert
On Thu, Feb 23, 2012 at 1:19 PM, Buck Golemon b...@yelp.com wrote: I feel like the design of sum() is inconsistent with other language features of python. Often python doesn't require a specific type, only that the type implement certain methods. Given a class that implements __add__ why

Re: sum() requires number, not simply __add__

2012-02-23 Thread Buck Golemon
On Feb 23, 1:32 pm, Chris Rebert c...@rebertia.com wrote: On Thu, Feb 23, 2012 at 1:19 PM, Buck Golemon b...@yelp.com wrote: I feel like the design of sum() is inconsistent with other language features of python. Often python doesn't require a specific type, only that the type implement

Re: sum() requires number, not simply __add__

2012-02-23 Thread Arnaud Delobelle
On 23 February 2012 21:23, Buck Golemon b...@yelp.com wrote: def sum(values, base=0):      values = iter(values)      try:          result = values.next()      except StopIteration:          return base      for value in values:          result += value      return result This is

Re: sum() requires number, not simply __add__

2012-02-23 Thread Stefan Behnel
Chris Rebert, 23.02.2012 22:32: On Thu, Feb 23, 2012 at 1:19 PM, Buck Golemon b...@yelp.com wrote: I feel like the design of sum() is inconsistent with other language features of python. Often python doesn't require a specific type, only that the type implement certain methods. Given a class

Re: sum() requires number, not simply __add__

2012-02-23 Thread Chris Angelico
On Fri, Feb 24, 2012 at 8:41 AM, Arnaud Delobelle arno...@gmail.com wrote: _sentinel = object() def sum(iterable, start=_sentinel):    if start is _sentinel: del _sentinel Somewhat off-topic: Doesn't the if statement there do a lookup for a global, which would mean that 'del _sentinel' will

Re: sum() requires number, not simply __add__

2012-02-23 Thread Ian Kelly
On Thu, Feb 23, 2012 at 2:38 PM, Buck Golemon b...@yelp.com wrote: My proposal is still *slightly* superior in two ways: 1) It reduces the number of __add__ operations by one 2) The second argument isn't strictly necessary, if you don't mind that the 'null sum' will produce zero. It produces

Re: sum() requires number, not simply __add__

2012-02-23 Thread Arnaud Delobelle
On 23 February 2012 21:53, Chris Angelico ros...@gmail.com wrote: On Fri, Feb 24, 2012 at 8:41 AM, Arnaud Delobelle arno...@gmail.com wrote: _sentinel = object() def sum(iterable, start=_sentinel):    if start is _sentinel: del _sentinel Somewhat off-topic: Doesn't the if statement there

Re: sum() requires number, not simply __add__

2012-02-23 Thread Ian Kelly
On Thu, Feb 23, 2012 at 2:53 PM, Chris Angelico ros...@gmail.com wrote: On Fri, Feb 24, 2012 at 8:41 AM, Arnaud Delobelle arno...@gmail.com wrote: _sentinel = object() def sum(iterable, start=_sentinel):    if start is _sentinel: del _sentinel Somewhat off-topic: Doesn't the if statement

Re: sum() requires number, not simply __add__

2012-02-23 Thread Chris Angelico
On Fri, Feb 24, 2012 at 8:59 AM, Arnaud Delobelle arno...@gmail.com wrote: def sum(iterable, start=_sentinel, _sentinel=_sentinel): Is this a reason for Python to introduce a new syntax, such as: def foo(blah, optional=del): if optional is del: print(No argument was provided) Basically,

Re: sum() requires number, not simply __add__

2012-02-23 Thread Arnaud Delobelle
On 23 February 2012 22:04, Chris Angelico ros...@gmail.com wrote: On Fri, Feb 24, 2012 at 8:59 AM, Arnaud Delobelle arno...@gmail.com wrote: def sum(iterable, start=_sentinel, _sentinel=_sentinel): Is this a reason for Python to introduce a new syntax, such as: def foo(blah, optional=del):  

Optional arguments syntax (was Re: sum() requires number, not simply __add__)

2012-02-23 Thread Chris Angelico
On Fri, Feb 24, 2012 at 9:09 AM, Arnaud Delobelle arno...@gmail.com wrote: On 23 February 2012 22:04, Chris Angelico ros...@gmail.com wrote: On Fri, Feb 24, 2012 at 8:59 AM, Arnaud Delobelle arno...@gmail.com wrote: def sum(iterable, start=_sentinel, _sentinel=_sentinel): Is this a reason for

Please verify!!

2012-02-23 Thread Manish Sharma
Hi I am new to python language. On my first day, somebody told me that if any python script file is opened with any editor except python editor, the file is corrupted. Some spacing or indentation is changed and script stops working. I was opening the script file in Windows using Notepad++ but I

Re: Please verify!!

2012-02-23 Thread Amirouche Boubekki
2012/2/23 Manish Sharma manish2...@gmail.com Hi I am new to python language. On my first day, somebody told me that if any python script file is opened with any editor except python editor, the file is corrupted. Some spacing or indentation is changed and script stops working. I was opening

Re: Please verify!!

2012-02-23 Thread Ben
They are telling you not to switch between editors that use tabs as tabs and ones that use spaces as tabs. Python gets all wonky. No big, use one editor or have your preferred editor highlight your non-preferred whitespace. FWIW, I use spaces. --

Re: Please verify!!

2012-02-23 Thread Chris Kaynor
On Thu, Feb 23, 2012 at 2:22 PM, Amirouche Boubekki amirouche.boube...@gmail.com wrote: 2012/2/23 Manish Sharma manish2...@gmail.com Hi I am new to python language. On my first day, somebody told me that if any python script file is opened with any editor except python editor, the file is

Re: Please verify!!

2012-02-23 Thread Dave Angel
On 02/23/2012 05:13 PM, Manish Sharma wrote: Hi I am new to python language. On my first day, somebody told me that if any python script file is opened with any editor except python editor, the file is corrupted. Some spacing or indentation is changed and script stops working. I was opening the

Re: sum() requires number, not simply __add__

2012-02-23 Thread Steven D'Aprano
On Fri, 24 Feb 2012 08:53:49 +1100, Chris Angelico wrote: On Fri, Feb 24, 2012 at 8:41 AM, Arnaud Delobelle arno...@gmail.com wrote: _sentinel = object() def sum(iterable, start=_sentinel):    if start is _sentinel: del _sentinel Somewhat off-topic: Doesn't the if statement there do a

Re: sum() requires number, not simply __add__

2012-02-23 Thread Chris Angelico
On Fri, Feb 24, 2012 at 10:33 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Yes, deleting _sentinel will cause the custom sum to fail, and yes, you have missed something. If the caller wants to mess with your library and break it, they have many, many ways to do so apart

Re: distutils bdist_wininst failure on Linux

2012-02-23 Thread Steven D'Aprano
On Thu, 23 Feb 2012 07:09:35 -0800, jmfauth wrote: On 23 fév, 15:06, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: Following instructions here: http://docs.python.org/py3k/distutils/builtdist.html#creating- windows... I am trying to create a Windows installer for a

Re: asynchronous downloading

2012-02-23 Thread Plumo
My current implementation works fine below a few hundred threads. But each thread takes up a lot of memory so does not scale well. I have been looking at Erlang for that reason, but found it is missing useful libraries in other areas. -- http://mail.python.org/mailman/listinfo/python-list

Re: distutils bdist_wininst failure on Linux

2012-02-23 Thread Steven D'Aprano
On Fri, 24 Feb 2012 00:11:11 +, Steven D'Aprano wrote: On Thu, 23 Feb 2012 07:09:35 -0800, jmfauth wrote: On 23 fév, 15:06, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: Following instructions here: http://docs.python.org/py3k/distutils/builtdist.html#creating-

A quirk/gotcha of for i, x in enumerate(seq) when seq is empty

2012-02-23 Thread Alex Willmer
This week I was slightly surprised by a behaviour that I've not considered before. I've long used for i, x in enumerate(seq): # do stuff as a standard looping-with-index construct. In Python for loops don't create a scope, so the loop variables are available afterward. I've sometimes used

Re: A quirk/gotcha of for i, x in enumerate(seq) when seq is empty

2012-02-23 Thread Steven D'Aprano
On Thu, 23 Feb 2012 16:30:09 -0800, Alex Willmer wrote: This week I was slightly surprised by a behaviour that I've not considered before. I've long used for i, x in enumerate(seq): # do stuff as a standard looping-with-index construct. In Python for loops don't create a scope, so

Re: asynchronous downloading

2012-02-23 Thread Plumo
that example is excellent - best use of asynchat I have seen so far. I read through the python-dev archives and found the fundamental problem is no one maintains asnycore / asynchat. -- http://mail.python.org/mailman/listinfo/python-list

Re: A quirk/gotcha of for i, x in enumerate(seq) when seq is empty

2012-02-23 Thread Paul Rubin
Alex Willmer a...@moreati.org.uk writes: i = 0 for x in seq: # do stuff i += 1 print 'Processed %i records' % i Just thought it worth mentioning, curious to hear other options/ improvements/corrections. Stephen gave an alternate patch, but you are right, it is a pitfall that can

Re: Please verify!!

2012-02-23 Thread Joshua Miller
Wasn't supposed to be private, just something went funky with gmail when i sent it out, oddly enough On Thu, Feb 23, 2012 at 8:32 PM, Dave Angel d...@davea.name wrote: On 02/23/2012 07:15 PM, Joshua Miller wrote: When he/she said python editor i'm sure they meant IDLE which in some cases is

Re: asynchronous downloading

2012-02-23 Thread Fayaz Yusuf Khan
On Thursday 23 Feb 2012 5:10:25 PM Plumo wrote: I read through the python-dev archives and found the fundamental problem is no one maintains asnycore / asynchat. By all means, scratch your own itch. :) -- Fayaz Yusuf Khan Cloud developer and architect Dexetra SS, Bangalore, India

Re: Please verify!!

2012-02-23 Thread Andrew Berg
On 2/23/2012 4:43 PM, Dave Angel wrote: First thing I'd do is to disable tab logic in the editor. When you press the tab key, there's no excuse for an editor to actually put a tab in the file. It should adjust the column by adding the appropriate number of spaces. Unless, of course, you

Re: A quirk/gotcha of for i, x in enumerate(seq) when seq is empty

2012-02-23 Thread Ethan Furman
Steven D'Aprano wrote: On Thu, 23 Feb 2012 16:30:09 -0800, Alex Willmer wrote: This week I was slightly surprised by a behaviour that I've not considered before. I've long used for i, x in enumerate(seq): # do stuff as a standard looping-with-index construct. In Python for loops don't

namespace question

2012-02-23 Thread xixiliguo
c = [1, 2, 3, 4, 5] class TEST(): c = [5, 2, 3, 4, 5] def add( self ): c[0] = 15 a = TEST() a.add() print( c, a.c, TEST.c ) result : [15, 2, 3, 4, 5] [5, 2, 3, 4, 5] [5, 2, 3, 4, 5] why a.add() do not update c in Class TEST? but update c in main file --

Re: generate Windows exe on Linux

2012-02-23 Thread Waldek M.
On Wed, 22 Feb 2012 18:42:11 +0100, Jérôme wrote: Has anyone had success generating exe's from within Linux? That doesn't seem to have anything to do with Python, but you might want to google for cross-compiling. I think his question is totally python related. As I understand it,

Re: namespace question

2012-02-23 Thread Chris Rebert
On Thu, Feb 23, 2012 at 9:55 PM, xixiliguo wangbo@gmail.com wrote: c = [1, 2, 3, 4, 5] class TEST():    c = [5, 2, 3, 4, 5] That line creates a class (i.e. static) variable, which is unlikely to be what you want. Instance variables are normally created in the body of an __init__() method.

Re: A quirk/gotcha of for i, x in enumerate(seq) when seq is empty

2012-02-23 Thread Mark Lawrence
On 24/02/2012 03:49, Ethan Furman wrote: Steven D'Aprano wrote: On Thu, 23 Feb 2012 16:30:09 -0800, Alex Willmer wrote: This week I was slightly surprised by a behaviour that I've not considered before. I've long used for i, x in enumerate(seq): # do stuff as a standard looping-with-index

Re: Please verify!!

2012-02-23 Thread Manish Sharma
Hi All, Thanks a ton for your replies! Still my question is what if I open the file and dont make any changes to it and close it again? Can it be possible just by doing these steps add indentation to lines? I am not changing the file prefrences to open it always with notepad++. Opening it once

Re: Please verify!!

2012-02-23 Thread Andrew Berg
On 2/24/2012 1:11 AM, Manish Sharma wrote: Still my question is what if I open the file and dont make any changes to it and close it again? Can it be possible just by doing these steps add indentation to lines? I am not changing the file prefrences to open it always with notepad++. Opening it

Re: Just curious: why is /usr/bin/python not a symlink?

2012-02-23 Thread Jerry Hill
On Thu, Feb 23, 2012 at 2:34 PM, HoneyMonster someone@someplace.invalid wrote: On Thu, 23 Feb 2012 14:24:23 -0500, Jerry Hill wrote: It's not two files, it's a hardlink.  You can confirm by running ls -li python* and comparing the inode numbers. You are spot on. Thank you, and sorry for my

Is Federal Reserve a Private Property or Public Property ? Exhilerating video by Honorable Alex Jones

2012-02-23 Thread small Pox
Is Federal Reserve a Private Property or Public Property ? Exhilerating video by Honorable Alex Jones http://www.youtube.com/watch?v=4UqcY8lGUUEfeature=g-vreccontext=G27... gnu.emacs.help,soc.culture.jewish,sci.electronics.design,comp.lang.scheme,comp.lang.python --

Re: Just curious: why is /usr/bin/python not a symlink?

2012-02-23 Thread Thomas Rachel
Am 23.02.2012 20:54 schrieb Jerry Hill: If I recall correctly, for directories, that's the number of entries in the directory. No. It is the number of subdirectories (it counts their .. entries) plus 2 (the parent directory and the own . entry). Even with that, it's hard to tell what

[issue13779] os.walk: bottom-up

2012-02-23 Thread patrick vrijlandt
patrick vrijlandt patrick.vrijla...@gmail.com added the comment: Good solution. +1 for closing. Patrick -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13779 ___

[issue13873] SIGBUS in test_big_buffer() of test_zlib on Debian bigmem buildbot

2012-02-23 Thread Charles-François Natali
Charles-François Natali neolo...@free.fr added the comment: File /var/tmpfs/martin.vonloewis/3.x.loewis-parallel2/build/Lib/test/test_zlib.py, line 96 in test_big_buffer The SIGBUS could be due to the buildbot running out of tmpfs. -- nosy: +neologix

[issue10805] traceback.print_exception throws AttributeError when exception is None

2012-02-23 Thread Giovanni Funchal
Giovanni Funchal gafunc...@gmail.com added the comment: This bug affects me, found it when migrating from 2.7 to 3.2, in a function calling traceback.print_exc() called while there were no active exception being handled. Previous behavior was to print None. -- nosy: +Giovanni.Funchal

[issue14098] provide public C-API for reading/setting sys.exc_info()

2012-02-23 Thread Stefan Behnel
Stefan Behnel sco...@users.sourceforge.net added the comment: I wonder if these functions should have an error return value, i.e. return -1 on failure. They'd never fail in CPython, but other implementations may want to report failures, in case their internal implementation is more involved.

[issue1521950] shlex.split() does not tokenize like the shell

2012-02-23 Thread Vinay Sajip
Vinay Sajip vinay_sa...@yahoo.co.uk added the comment: Éric Araujo mer...@netwok.org added the comment: I did not fully get what you meant here, but the example you added to the doc made it clear.  Is this covered by tests? Yes, I believe that testSyntaxSplitCustom covers this. Overall great

[issue14099] zipfile: ZipFile.open() should not reopen the underlying file

2012-02-23 Thread Stepan Kasal
New submission from Stepan Kasal ka...@ucw.cz: When a file inside a zip is open, the underlying zip file is open again. (Unless the file name is unknown, because the ZipFile object was created with fp only.) This design is incorrect, insecure, and ineffective: - the reopen uses the same string

[issue14099] zipfile: ZipFile.open() should not reopen the underlying file

2012-02-23 Thread Matej Cepl
Changes by Matej Cepl mc...@redhat.com: -- nosy: +mcepl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14099 ___ ___ Python-bugs-list mailing list

[issue14095] type_new() removes __qualname__ from the input dictionary

2012-02-23 Thread sbt
sbt shibt...@gmail.com added the comment: I get a segfault with Python 3.3.0a0 (default:31784350f849, Feb 23 2012, 11:07:41) [GCC 4.5.2] on linux Type help, copyright, credits or license for more information. d = {'__qualname__':'XXX'} T = type('foo', (), d) d Segmentation

[issue13873] SIGBUS in test_big_buffer() of test_zlib on Debian bigmem buildbot

2012-02-23 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset f3f3bb45205b by Nadeem Vawda in branch 'default': Issue #13873: Fix crash in test_zlib on bigmem buildbot. http://hg.python.org/cpython/rev/f3f3bb45205b -- nosy: +python-dev

[issue14091] python subprocess hangs if script called from another directory

2012-02-23 Thread Massimo Paladin
Massimo Paladin massimo.pala...@gmail.com added the comment: Will follow it. Thanks, -Massimo -- resolution: - works for me status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14091

[issue13873] SIGBUS in test_big_buffer() of test_zlib on Debian bigmem buildbot

2012-02-23 Thread Nadeem Vawda
Nadeem Vawda nadeem.va...@gmail.com added the comment: The SIGBUS could be due to the buildbot running out of tmpfs. I haven't been able to reproduce the crash by running the test on a tmpfs on my own machine (Ubuntu AMD64; 8GB RAM; Linux 3.0.0-15-generic; zlib 1:1.2.3.4.dfsg-3ubuntu3), but

[issue14087] multiprocessing.Condition.wait_for missing

2012-02-23 Thread sbt
sbt shibt...@gmail.com added the comment: Patch which just copies the implementation from threading. -- keywords: +patch Added file: http://bugs.python.org/file24611/cond_wait_for.patch ___ Python tracker rep...@bugs.python.org

[issue1521950] shlex.split() does not tokenize like the shell

2012-02-23 Thread Dan Christian
Dan Christian robo...@users.sourceforge.net added the comment: I haven't been following this much. Sorry. My day job isn't in this area any more (and I'm stuck using 2.4 :-(). Looking at the docs, I notice the old is different from what it used to be. Notably: 'e;' gets split into two

[issue14100] expose a note a hidden note

2012-02-23 Thread Tshepang Lekhonkhobe
New submission from Tshepang Lekhonkhobe tshep...@gmail.com: I wonder if this note was hidden deliberately. -- assignee: docs@python components: Documentation files: make-note-visible.patch keywords: patch messages: 154065 nosy: docs@python, tshepang priority: normal severity: normal

[issue14100] expose a note a hidden note

2012-02-23 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +haypo, pitrou stage: - patch review type: - enhancement ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14100 ___

[issue2209] mailbox module doesn't support compressed mbox

2012-02-23 Thread Jesús Cea Avión
Jesús Cea Avión j...@jcea.es added the comment: Jürgen, would you consider writing a patch? -- nosy: +jcea versions: +Python 3.3 -Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2209

[issue14100] expose a hidden note

2012-02-23 Thread Tshepang Lekhonkhobe
Changes by Tshepang Lekhonkhobe tshep...@gmail.com: -- title: expose a note a hidden note - expose a hidden note ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14100 ___

[issue14098] provide public C-API for reading/setting sys.exc_info()

2012-02-23 Thread Stefan Behnel
Stefan Behnel sco...@users.sourceforge.net added the comment: Writing up a test case, I noticed that it makes sense to let PyErr_SetExcInfo() steal the references. This matches the main use case of saving and restoring the fields. For the getter, it's still best to return new references in

[issue14100] expose a hidden note

2012-02-23 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Well, presumably the XXX tells you why it's hidden. -- nosy: +loewis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14100 ___

[issue14098] provide public C-API for reading/setting sys.exc_info()

2012-02-23 Thread Stefan Behnel
Changes by Stefan Behnel sco...@users.sourceforge.net: -- keywords: +patch Added file: http://bugs.python.org/file24613/exc_info_capi.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14098

[issue14095] type_new() removes __qualname__ from the input dictionary

2012-02-23 Thread Meador Inge
Changes by Meador Inge mead...@gmail.com: -- nosy: +meador.inge ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14095 ___ ___ Python-bugs-list

[issue10848] Move test.regrtest from getopt to argparse

2012-02-23 Thread Tshepang Lekhonkhobe
Changes by Tshepang Lekhonkhobe tshep...@gmail.com: -- nosy: +tshepang ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10848 ___ ___

[issue2377] Replace __import__ w/ importlib.__import__

2012-02-23 Thread Brett Cannon
Brett Cannon br...@python.org added the comment: On Wed, Feb 22, 2012 at 19:35, Éric Araujo rep...@bugs.python.org wrote: I have already done that and pushed the initial change. The ultimate goal will be fetching from sys.modules when level == 0 and not bool(fromlist) only touch C code. All

[issue13447] Add tests for some scripts in Tools/scripts

2012-02-23 Thread Nadeem Vawda
Nadeem Vawda nadeem.va...@gmail.com added the comment: Shall I commit the new file or first add more tests? Might as well commit now; there's no sense in leaving the code sitting around just because the file feels a bit short. A couple of minor nits about your patch, though: - The docstring

  1   2   >