Re: Compiling Python (modules) on 64bit Windows - which compiler suite?

2012-03-22 Thread Stefan Behnel
Thomas Bach, 21.03.2012 20:03: Ralph Heinkel writes: when processing our mass spectrometry data we are running against the 2GB memory limit on our 32 bit machines. So we are planning to move to 64bit. Downloading and installing the 64bit version of Python for Windows is trivial, but how do we

Re: Python is readable

2012-03-22 Thread Steven D'Aprano
On Wed, 21 Mar 2012 18:35:16 -0700, Steve Howell wrote: On Mar 21, 11:06 am, Nathan Rice nathan.alexander.r...@gmail.com wrote: As for syntax, we have a lot of real domain specific languages, such as English, math and logic. They are vetted, understood and useful outside the context of

Python classes: Simplify?

2012-03-22 Thread Steven Lehar
It seems to me that the Python class system is needlessly confusing. Am I missing something? For example in the class Complex given in the documentation *class Complex:* *def __init__(self, realpart, imagpart):* *self.r = realpart* *self.i = imagpart* * * *x = Complex(3.0,

Re: Python classes: Simplify?

2012-03-22 Thread Chris Angelico
On Thu, Mar 22, 2012 at 9:51 PM, Steven Lehar sle...@gmail.com wrote: It seems to me that the Python class system is needlessly confusing. Am I missing something? For example in the class Complex given in the documentation class Complex:     def __init__(self, realpart, imagpart):        

Re: Python classes: Simplify?

2012-03-22 Thread Chris Rebert
On Thu, Mar 22, 2012 at 3:51 AM, Steven Lehar sle...@gmail.com wrote: It seems to me that the Python class system is needlessly confusing. Am I missing something? Explicit `self` is slightly annoying, but you'll get over it quickly (trust me). For example in the class Complex given in the

Re: Python is readable (OT)

2012-03-22 Thread Jon Clements
On Thursday, 22 March 2012 08:56:17 UTC, Steven D#39;Aprano wrote: On Wed, 21 Mar 2012 18:35:16 -0700, Steve Howell wrote: On Mar 21, 11:06 am, Nathan Rice nathan.alexander.r...@gmail.com wrote: [snip]. Different programming languages are good for different things because they have

Re: Accessing the files by last modified time

2012-03-22 Thread Chris Rebert
On Thu, Mar 22, 2012 at 4:33 AM, Sangeet mrsang...@gmail.com wrote: Hi I am new to the python programming language. I've been trying to write a script that would access the last modified file in one of my directories. I'm using Win XP. I saw a similar topic, on the forum before, however

Re: Accessing the files by last modified time

2012-03-22 Thread Tim Williams
On Mar 22, 7:33 am, Sangeet mrsang...@gmail.com wrote: Hi I am new to the python programming language. I've been trying to write a script that would access the last modified file in one of my directories. I'm using Win XP. I saw a similar topic, on the forum before, however the reply

Re: Accessing the files by last modified time

2012-03-22 Thread Peter Otten
Sangeet wrote: I've been trying to write a script that would access the last modified file in one of my directories. I'm using Win XP. import os import glob path = rc:\one\of\my directories\* youngest_file = max(glob.glob(path), key=os.path.getmtime) --

Re: Python is readable

2012-03-22 Thread Nathan Rice
If I'm reading you correctly, you're expressing frustration with the state of language syntax unification in 2012. You mention language in a broad sense (not just programming languages, but also English, math, logic, etc.), but even in the narrow context of programming languages, the current

Re: Accessing the files by last modified time

2012-03-22 Thread Neil Cerutti
On 2012-03-22, Tim Williams tjand...@cox.net wrote: On Mar 22, 7:33?am, Sangeet mrsang...@gmail.com wrote: Hi I am new to the python programming language. I've been trying to write a script that would access the last modified file in one of my directories. I'm using Win XP. I saw a

Re: Best way to disconnect from ldap?

2012-03-22 Thread Tycho Andersen
On Wed, Mar 21, 2012 at 04:49:54PM -0500, Tim Chase wrote: On 03/21/12 15:54, Chris Kaynor wrote: As Chris Rebert pointed out, there is no guarantee as to when the __del__ method is called. CPython will generally call it immediately, however if there are reference cycles it may never call it

Re: Python is readable

2012-03-22 Thread Chris Angelico
On Thu, Mar 22, 2012 at 11:47 PM, Nathan Rice nathan.alexander.r...@gmail.com wrote: Having one core language with many DSLs that can interoperate is infinitely better than having many languages that cannot.  A language designed in such a way would also prevent issues like the Python 2 - 3

Re: Python classes: Simplify?

2012-03-22 Thread Andrea Crotti
On 03/22/2012 10:51 AM, Steven Lehar wrote: It seems to me that the Python class system is needlessly confusing. Am I missing something? For example in the class Complex given in the documentation *class Complex:* *def __init__(self, realpart, imagpart):* *self.r = realpart* *

Re: Best way to disconnect from ldap?

2012-03-22 Thread Chris Rebert
On Thu, Mar 22, 2012 at 6:14 AM, Tycho Andersen ty...@tycho.ws wrote: On Wed, Mar 21, 2012 at 04:49:54PM -0500, Tim Chase wrote: On 03/21/12 15:54, Chris Kaynor wrote: As Chris Rebert pointed out, there is no guarantee as to when the __del__ method is called. CPython will generally call it

Re: Best way to disconnect from ldap?

2012-03-22 Thread Tycho Andersen
On Thu, Mar 22, 2012 at 06:27:45AM -0700, Chris Rebert wrote: On Thu, Mar 22, 2012 at 6:14 AM, Tycho Andersen ty...@tycho.ws wrote: On Wed, Mar 21, 2012 at 04:49:54PM -0500, Tim Chase wrote: On 03/21/12 15:54, Chris Kaynor wrote: As Chris Rebert pointed out, there is no guarantee as to when

Re: Python is readable

2012-03-22 Thread Nathan Rice
On Thu, Mar 22, 2012 at 9:17 AM, Chris Angelico ros...@gmail.com wrote: On Thu, Mar 22, 2012 at 11:47 PM, Nathan Rice nathan.alexander.r...@gmail.com wrote: Having one core language with many DSLs that can interoperate is infinitely better than having many languages that cannot.  A language

Condition in C API

2012-03-22 Thread Matt Joiner
Is there a Condition-like object exposed in the CPython C API? I've found PyThread_lock_type, but nothing condition-like. -- http://mail.python.org/mailman/listinfo/python-list

RE: urllib.urlretrieve never returns???

2012-03-22 Thread Prasad, Ramit
I just looked at your source file on ActiveState and noticed that you do not import traceback. That is why you are getting the AttributeError. Now you should be getting a much better error once you import it:) Nope. That would result in a NameError. After adding import traceback, I still

Re: Python is readable

2012-03-22 Thread Steve Howell
On Mar 22, 1:56 am, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: On Wed, 21 Mar 2012 18:35:16 -0700, Steve Howell wrote: On Mar 21, 11:06 am, Nathan Rice nathan.alexander.r...@gmail.com wrote: As for syntax, we have a lot of real domain specific languages, such as English,

Re: Python is readable

2012-03-22 Thread Steve Howell
On Mar 22, 7:29 am, Nathan Rice nathan.alexander.r...@gmail.com wrote: On Thu, Mar 22, 2012 at 9:17 AM, Chris Angelico ros...@gmail.com wrote: On Thu, Mar 22, 2012 at 11:47 PM, Nathan Rice nathan.alexander.r...@gmail.com wrote: Having one core language with many DSLs that can interoperate

ANN: Leo 4.10 b1 released

2012-03-22 Thread Edward K. Ream
Leo 4.10 b1 is now available at: http://sourceforge.net/projects/leo/files/ Leo is a text editor, data organizer, project manager and much more. http://webpages.charter.net/edreamleo/intro.html Leo 4.10 contains 9 months of intense work on Leo. Several very important features are subtle; you

Re: Python is readable

2012-03-22 Thread Steven D'Aprano
On Thu, 22 Mar 2012 08:47:15 -0400, Nathan Rice wrote: There is a concept in statistical/mathematical modeling called minimum message length (a close analog is minimum description length), which asserts that the optimum model for some set of information is the one that minimizes the sum of

Re: Best way to disconnect from ldap?

2012-03-22 Thread Steven D'Aprano
On Thu, 22 Mar 2012 08:14:47 -0500, Tycho Andersen wrote: I've had similar experiences. In fact, in light of all this - why does __del__ exist at all? Novice python users may (reasonably) assume it behaves similarly to a C++ destructor (even though the docs warn otherwise). What makes you

Re: Python is readable

2012-03-22 Thread Steven D'Aprano
On Thu, 22 Mar 2012 10:29:48 -0400, Nathan Rice wrote: [Snip a load of stuff about the laws of physics, infinity, and of course fractals.] I'm just surprised you didn't manage to fit quantum mechanics and the interconnectedness of all things into it :) TL;DR there are a huge number of

Re: Best way to disconnect from ldap?

2012-03-22 Thread Tim Chase
On 03/22/12 12:26, Steven D'Aprano wrote: On Thu, 22 Mar 2012 08:14:47 -0500, Tycho Andersen wrote: Given that you can't trust __del__, is there a legitimate use case for it? I've never found the need to write one. I've found the need to write them...then been frustrated by things falling

Re: Python classes: Simplify?

2012-03-22 Thread J. Cliff Dyer
The issue of explicitly naming a self parameter has been discussed in depth on a number of occasions. I recommend a google search for python implicit self for some of the reasons why it exists. Here's what Guido has to say about it:

Re: Python is readable

2012-03-22 Thread Nathan Rice
There is a concept in statistical/mathematical modeling called minimum message length (a close analog is minimum description length), which asserts that the optimum model for some set of information is the one that minimizes the sum of the length of the model and the length of the set

Re: Compiling Python (modules) on 64bit Windows - which compiler suite?

2012-03-22 Thread Ralph Heinkel
See Compiling 64-bit extension modules on Windows at http://wiki.cython.org/64BitCythonExtensionsOnWindows. It applies to non-Cython extensions as well. MinGW-w64 also works, but you'll have to generate and use libpythonXX.a and libmsvcr90.a link libraries. Christoph Thanks to

Re: Python is readable

2012-03-22 Thread Chris Angelico
On Fri, Mar 23, 2012 at 5:26 AM, Nathan Rice nathan.alexander.r...@gmail.com wrote: [regarding Python 2 - 3] The extremely slow uptake?  I don't really care one way or another but a lot of the devs have lamented the issue. By your plan, the slow uptake would be accepted, even encouraged. In

Number of languages known [was Re: Python is readable] - somewhat OT

2012-03-22 Thread Chris Angelico
On Fri, Mar 23, 2012 at 4:44 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: The typical developer knows three, maybe four languages moderately well, if you include SQL and regexes as languages, and might have a nodding acquaintance with one or two more. I'm not entirely sure

Re: Python is readable

2012-03-22 Thread Chris Angelico
On Fri, Mar 23, 2012 at 1:29 AM, Nathan Rice nathan.alexander.r...@gmail.com wrote: For example, your ability to reason about the behavior of the system you posited as a whole is limited.  Are there parts of the different modules that can execute concurrently?  Is the output of module1

Re: Best way to disconnect from ldap?

2012-03-22 Thread Terry Reedy
On 3/22/2012 1:54 PM, Tim Chase wrote: On 03/22/12 12:26, Steven D'Aprano wrote: On Thu, 22 Mar 2012 08:14:47 -0500, Tycho Andersen wrote: Given that you can't trust __del__, is there a legitimate use case for it? It is part of original or early Python and pretty well superceded by cyclic

Re: Python is readable

2012-03-22 Thread Nathan Rice
For example, your ability to reason about the behavior of the system you posited as a whole is limited.  Are there parts of the different modules that can execute concurrently?  Is the output of module1 guaranteed to be acceptable as the input for module2?  Is part of module3 redundant (and

Re: Python is readable

2012-03-22 Thread Chris Angelico
On Fri, Mar 23, 2012 at 6:33 AM, Nathan Rice nathan.alexander.r...@gmail.com wrote: Pipes do not provide any fine grained control over the concurrent behavior.  If you want to change the order of calls, suddenly you have to write a bash script (with its own set of issues), etc. Go back to my

Odd strip behavior

2012-03-22 Thread Rodrick Brown
#!/usr/bin/python def main(): str1='this is a test' str2='t' print .join([ c for c in str1 if c not in str2 ]) print(str1.strip(str2)) if __name__ == '__main__': main() ./remove_str.py his is a es his is a tes Why wasnt the t removed ? Sent from my iPhone --

Re: Python is readable

2012-03-22 Thread Chris Angelico
On Fri, Mar 23, 2012 at 6:33 AM, Nathan Rice nathan.alexander.r...@gmail.com wrote: Pipes do not provide any fine grained control over the concurrent behavior.  If you want to change the order of calls... And to clarify: The order of calls in what I described is merely the order of

Re: Odd strip behavior

2012-03-22 Thread Arnaud Delobelle
On Mar 22, 2012 7:49 PM, Rodrick Brown rodrick.br...@gmail.com wrote: #!/usr/bin/python def main(): str1='this is a test' str2='t' print .join([ c for c in str1 if c not in str2 ]) print(str1.strip(str2)) if __name__ == '__main__': main() ./remove_str.py his is a es

RE: Odd strip behavior

2012-03-22 Thread Prasad, Ramit
str1='this is a test' str2='t' print .join([ c for c in str1 if c not in str2 ]) print(str1.strip(str2)) if __name__ == '__main__': main() ./remove_str.py his is a es his is a tes Why wasnt the t removed ? This is not odd behavior, you just do not understand

Re: Odd strip behavior

2012-03-22 Thread Kiuhnm
On 3/22/2012 20:48, Rodrick Brown wrote: #!/usr/bin/python def main(): str1='this is a test' str2='t' print .join([ c for c in str1 if c not in str2 ]) print(str1.strip(str2)) if __name__ == '__main__': main() ./remove_str.py his is a es his is a tes Why wasnt the

Re: Odd strip behavior

2012-03-22 Thread Daniel Steinberg
strip() removes leading and trailing characters, which is why the 't' in the middle of the string was not removed. To remove the 't' in the middle, str1.replace('t','') is one option. On 3/22/12 3:48 PM, Rodrick Brown wrote: #!/usr/bin/python def main(): str1='this is a test'

Re: Odd strip behavior

2012-03-22 Thread Rodrick Brown
On Mar 22, 2012, at 3:53 PM, Arnaud Delobelle arno...@gmail.com wrote: On Mar 22, 2012 7:49 PM, Rodrick Brown rodrick.br...@gmail.com wrote: #!/usr/bin/python def main(): str1='this is a test' str2='t' print .join([ c for c in str1 if c not in str2 ])

Re: Odd strip behavior

2012-03-22 Thread Arnaud Delobelle
On 22 March 2012 20:04, Rodrick Brown rodrick.br...@gmail.com wrote: On Mar 22, 2012, at 3:53 PM, Arnaud Delobelle arno...@gmail.com wrote: Try help(ste.strip) It clearly states if chars is given and not None, remove characters in chars instead. Does it mean remove only the first

Re: Odd strip behavior

2012-03-22 Thread Ian Kelly
On Thu, Mar 22, 2012 at 1:48 PM, Rodrick Brown rodrick.br...@gmail.com wrote: Why wasnt the t removed ? Because str.strip() only removes leading or trailing characters. If you want to remove all the t's, use str.replace: 'this is a test'.replace('t', '') Cheers, Ian --

Re: Best way to disconnect from ldap?

2012-03-22 Thread Tycho Andersen
On Thu, Mar 22, 2012 at 05:26:11PM +, Steven D'Aprano wrote: On Thu, 22 Mar 2012 08:14:47 -0500, Tycho Andersen wrote: I've had similar experiences. In fact, in light of all this - why does __del__ exist at all? Novice python users may (reasonably) assume it behaves similarly to a C++

Re: Number of languages known [was Re: Python is readable] - somewhat OT

2012-03-22 Thread Steven D'Aprano
On Fri, 23 Mar 2012 06:14:46 +1100, Chris Angelico wrote: On Fri, Mar 23, 2012 at 4:44 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: The typical developer knows three, maybe four languages moderately well, if you include SQL and regexes as languages, and might have a

Re: Python is readable

2012-03-22 Thread Steve Howell
On Mar 22, 10:44 am, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: On Thu, 22 Mar 2012 10:29:48 -0400, Nathan Rice wrote: Or at least before *I* black out. Even if somebody manages to write your meta-language, you're going to run into the problem of who is going to be able to

Re: Number of languages known [was Re: Python is readable] - somewhat OT

2012-03-22 Thread Steve Howell
On Mar 22, 6:11 pm, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: On Fri, 23 Mar 2012 06:14:46 +1100, Chris Angelico wrote: In any case, though, I agree that there's a lot of people professionally writing code who would know about the 3-4 that you say. I'm just not sure that

Re: Number of languages known [was Re: Python is readable] - somewhat OT

2012-03-22 Thread Steve Howell
On Mar 22, 12:14 pm, Chris Angelico ros...@gmail.com wrote: On Fri, Mar 23, 2012 at 4:44 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: The typical developer knows three, maybe four languages moderately well, if you include SQL and regexes as languages, and might have a

Re: Python is readable

2012-03-22 Thread rusi
On Mar 23, 7:42 am, Steve Howell showel...@yahoo.com wrote: Do you think we'll always have a huge number of incompatible programming languages?  I agree with you that it's a fact of life in 2012, but will it be a fact of life in 2062? It will be a fact of life wherever Godels theorem is;

Re: Python is readable

2012-03-22 Thread Steve Howell
On Mar 22, 8:20 pm, rusi rustompm...@gmail.com wrote: On Mar 23, 7:42 am, Steve Howell showel...@yahoo.com wrote: Do you think we'll always have a huge number of incompatible programming languages?  I agree with you that it's a fact of life in 2012, but will it be a fact of life in 2062?

Re: Python is readable

2012-03-22 Thread Nathan Rice
Do you think we'll always have a huge number of incompatible programming languages?  I agree with you that it's a fact of life in 2012, but will it be a fact of life in 2062? It will be a fact of life wherever Godels theorem is; which put simplistically is: consistency and completeness

Re: Python is readable

2012-03-22 Thread MRAB
On 23/03/2012 04:16, Steve Howell wrote: On Mar 22, 8:20 pm, rusirustompm...@gmail.com wrote: On Mar 23, 7:42 am, Steve Howellshowel...@yahoo.com wrote: Do you think we'll always have a huge number of incompatible programming languages? I agree with you that it's a fact of life in

[issue14360] email.encoders.encode_quopri doesn't work with python 3.2

2012-03-22 Thread Dmitry Shachnev
Dmitry Shachnev mity...@gmail.com added the comment: Then, which types of argument should encode_* functions take (I think str should be supported, and it's not a case here as encode_quopri will only accept bytes)? I meant which types of *payload* should they accept. Here's an illustration

[issue14357] Distutils2 does not work with virtualenv

2012-03-22 Thread Alex Grönholm
Alex Grönholm alex.gronholm+pyt...@nextday.fi added the comment: Kubuntu 11.10, 64-bit. No ~/.pydistutils.cfg. What other info do you need? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14357

[issue9528] Add pure Python implementation of time module to CPython

2012-03-22 Thread Matt Joiner
Changes by Matt Joiner anacro...@gmail.com: -- nosy: +anacrolix ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9528 ___ ___ Python-bugs-list

[issue14387] Include\accu.h incompatible with Windows.h

2012-03-22 Thread Jeff Robbins
New submission from Jeff Robbins je...@livedata.com: Windows.h includes RpcNdr.h which does this: #define small char accu.h in Python\Include (Python 3.2.3rc2) has this in it: typedef struct { PyObject *large; /* A list of previously accumulated large strings */ PyObject *small; /*

[issue4024] float(0.0) singleton

2012-03-22 Thread Kristján Valur Jónsson
Changes by Kristján Valur Jónsson krist...@ccpgames.com: -- superseder: - Intern certain integral floats for memory savings and performance ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4024

[issue14387] Include\accu.h incompatible with Windows.h

2012-03-22 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: I suggest to remove accu.h from Python.h: all functions are private anyway, and it's only used by couple of files. -- assignee: - pitrou nosy: +amaury.forgeotdarc, pitrou ___ Python tracker

[issue14378] __future__ imports fail when compiling from python ast

2012-03-22 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset f57cbcefde34 by Benjamin Peterson in branch '3.2': check by equality for __future__ not identity (closes #14378) http://hg.python.org/cpython/rev/f57cbcefde34 New changeset 9d793be3b4eb by Benjamin Peterson in

[issue14360] email.encoders.encode_quopri doesn't work with python 3.2

2012-03-22 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: email in python3 doesn't necessarily work with binary payloads. (Obviously here you've found the opposite problem, but it is in methods that aren't used by the package itself.) There aren't any tests of binary payloads in the test

[issue14078] Add 'sourceline' property to xml.etree Elements

2012-03-22 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- keywords: +needs review stage: - patch review type: - enhancement ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14078 ___

[issue14386] Expose dictproxy as a public type

2012-03-22 Thread STINNER Victor
STINNER Victor victor.stin...@gmail.com added the comment: Patch version 2: - add tests and documentation - dictproxy code moved to dictproxyobject.c - dict_proxy replaced with dictproxy in repr(dictproxy) - key in dictproxy now handles correctly dict subclasses - dictproxy constructor

[issue14386] Expose dictproxy as a public type

2012-03-22 Thread STINNER Victor
STINNER Victor victor.stin...@gmail.com added the comment: The dictproxy is useful to implement a Python sandbox: see the related issue #14385. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14386

[issue14385] Support other types than dict for __builtins__

2012-03-22 Thread STINNER Victor
STINNER Victor victor.stin...@gmail.com added the comment: Note: this protection is not enough to secure Python, but it is an important part of a Python sandbox. Oh, and by the way, I workaround the lack of read-only mapping in pysandbox by removing dict methods: dict.__init__(),

[issue14367] try/except block in ismethoddescriptor() in inspect.py, so that pydoc works with pygame in Python 3.2

2012-03-22 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Thanks for the report and patch. However, in general we prefer not to mask exceptions (doing that can hide bugs in programs). It would probably be reasonable to fix this in pydoc, however. Alternatively there might be a specific

[issue14387] Include\accu.h incompatible with Windows.h

2012-03-22 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +benjamin.peterson, georg.brandl priority: normal - release blocker versions: +Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14387

[issue14378] __future__ imports fail when compiling from python ast

2012-03-22 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: After this commit the buildbots are dying randomly with segfaults. -- nosy: +r.david.murray priority: normal - release blocker status: closed - open ___ Python tracker rep...@bugs.python.org

[issue14378] __future__ imports fail when compiling from python ast

2012-03-22 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 1729ec440bb6 by Benjamin Peterson in branch '2.7': check by equality for __future__ not identity (closes #14378) http://hg.python.org/cpython/rev/1729ec440bb6 -- status: open - closed

[issue14378] __future__ imports fail when compiling from python ast

2012-03-22 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: 1b467efb9b27 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14378 ___ ___

[issue14382] test_unittest crashes loading 'unittest.test.testmock' when run from installed Python

2012-03-22 Thread Vinay Sajip
Vinay Sajip vinay_sa...@yahoo.co.uk added the comment: This should be fixable using the attached patch. -- keywords: +patch nosy: +vinay.sajip stage: needs patch - patch review type: - behavior Added file: http://bugs.python.org/file24992/Makefile.pre.in.diff

[issue14078] Add 'sourceline' property to xml.etree Elements

2012-03-22 Thread Eli Bendersky
Eli Bendersky eli...@gmail.com added the comment: Hi Leon, Thanks for the patch. I suggest to start by raising this to the python-ideas mailing list, to see if anyone has objections / different idea about doing this. Next, keep in mind that starting with 3.3, the default ElementTree

[issue14388] configparser.py traceback

2012-03-22 Thread Sol Jerome
New submission from Sol Jerome solj+...@soljerome.com: This seems like it could be user error, but the traceback doesn't provide useful information on where the problem could be. The relevant class is at the following URL.

[issue14387] Include\accu.h incompatible with Windows.h

2012-03-22 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset f34ac2e9d5cf by Antoine Pitrou in branch '3.2': Issue #14387: Do not include accu.h from Python.h. http://hg.python.org/cpython/rev/f34ac2e9d5cf New changeset 5fe7d19ec49a by Antoine Pitrou in branch 'default':

[issue14387] Include\accu.h incompatible with Windows.h

2012-03-22 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Fixed according to Amaury's suggestion. Georg, Benjamin, I think this should probably go into the final releases. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14387

[issue14388] configparser.py traceback

2012-03-22 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Looking at the traceback and your code, configparser is calling 'get', expecting to call its own get method (that takes a 'raw' keyword), but instead is calling the get on your subclass, which doesn't take a 'raw' keyword. Since this

[issue13325] no address in the representation of asyncore dispatcher after connection established

2012-03-22 Thread Giampaolo Rodola'
Giampaolo Rodola' g.rod...@gmail.com added the comment: Closing as duplicate of issue 13694. -- resolution: - duplicate status: open - closed versions: +Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13325

[issue14381] Intern certain integral floats for memory savings and performance

2012-03-22 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Yes, there is a measurable performance decrease in pybench arithmetic tests. Integers don't fall out of arithmetic that often, true. But integral floats are incredibly common in tabular data. In a game such as Eve Online,

[issue14382] test_unittest crashes loading 'unittest.test.testmock' when run from installed Python

2012-03-22 Thread Michael Foord
Michael Foord mich...@voidspace.org.uk added the comment: Thanks vinay (and ned). I thought that was the cause of the problem - but glad you diagnosed and fixed it before I had to look into it. Patch looks good to apply. -- ___ Python tracker

[issue14381] Intern certain integral floats for memory savings and performance

2012-03-22 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Integers don't fall out of arithmetic that often, true. But integral floats are incredibly common in tabular data. In a game such as Eve Online, configuration data contains a lot of 0.0, 1.0, -1.0 and so on. This patch saved us many

[issue10340] asyncore doesn't properly handle EINVAL on OSX

2012-03-22 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 8c19c9914c22 by Giampaolo Rodola' in branch '2.7': fix #10340: properly handle EINVAL on OSX and also avoid to call handle_connect() in case of a disconnetected socket which is not meant to connect.

[issue14381] Intern certain integral floats for memory savings and performance

2012-03-22 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: The -10..11 range was determined empirically. As you see from the values, only -10 shows up as significant... In fact, just storing 0 to 5 would capture the bulk of the savings. Right, I'll do some test with the hardcoded

[issue14381] Intern certain integral floats for memory savings and performance

2012-03-22 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Right, I'll do some test with the hardcoded values you mentioned. Btw, I don't think -0.0 is worth it, that value is a typical arithmetic result and not something you typically get from input data. I was suggesting -0.0 in the hope that it

[issue10340] asyncore doesn't properly handle EINVAL on OSX

2012-03-22 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset e2cddb3f4526 by Giampaolo Rodola' in branch '3.2': fix #10340: properly handle EINVAL on OSX and also avoid to call handle_connect() in case of a disconnetected socket which is not meant to connect.

[issue14381] Intern certain integral floats for memory savings and performance

2012-03-22 Thread Serhiy Storchaka
Serhiy Storchaka storch...@gmail.com added the comment: Try moving your changes from PyFloat_FromDouble to PyFloat_FromString. Look at memory and perfomance. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14381

[issue10340] asyncore doesn't properly handle EINVAL on OSX

2012-03-22 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 8c1fd9276b25 by Giampaolo Rodola' in branch '3.2': issue 10340 - forgot to update Misc/NEWS http://hg.python.org/cpython/rev/8c1fd9276b25 -- ___ Python tracker

[issue10340] asyncore doesn't properly handle EINVAL on OSX

2012-03-22 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 13cefcbcc7da by Giampaolo Rodola' in branch 'default': fix #10340: properly handle EINVAL on OSX and also avoid to call handle_connect() in case of a disconnetected socket which is not meant to connect.

[issue14228] It is impossible to catch sigint on startup in python code

2012-03-22 Thread telmich
telmich nico-bugs.python@schottelius.org added the comment: It seems not even using -S fixes the problem: [16:25] brief:python-traceback-test% head -n 2 caller.py #!/usr/bin/python3 -S [16:25] brief:python-traceback-test% ./caller.py Indirect child being called Indirect child being

[issue10340] asyncore doesn't properly handle EINVAL on OSX

2012-03-22 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' g.rod...@gmail.com: -- assignee: - giampaolo.rodola priority: high - normal resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org

[issue14228] It is impossible to catch sigint on startup in python code

2012-03-22 Thread telmich
telmich nico-bugs.python@schottelius.org added the comment: I think setting up SIGINT after importing site is a good solution: It will kill the program as expected and as soon as the user takes over control, she can decide what todo. In which stage/part is the python interpreter when I

[issue14389] Mishandling of large numbers

2012-03-22 Thread Practicing Zazen
New submission from Practicing Zazen itisgenerallyagr...@gmail.com: Please let me know if this is accepted behavior or not. 9*999 8991 9*999+0.1 8990.0 9*999+1 8992 -- messages: 156576 nosy: Practicing.Zazen

[issue14367] try/except block in ismethoddescriptor() in inspect.py, so that pydoc works with pygame in Python 3.2

2012-03-22 Thread Dave Burton
Dave Burton ncdave4l...@gmail.com added the comment: Well, the exception is NotImplementedError. It's raised explicitly in pygame\__init__.py I uncommented my commented-out print statement in inspect.py, and added a traceback print, and ran pydoc like this: c:\python32\python.exe

[issue14381] Intern certain integral floats for memory savings and performance

2012-03-22 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: PyFloat_FromString() is very restrictive. In our case, for example, the floats in question don't come from text files. I'm adding a new file with changes suggested by Antoine. only 0.0 and 1.0 are interned. It turns out that

[issue14389] Mishandling of large numbers

2012-03-22 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: See http://docs.python.org/dev/faq/design.html#why-are-floating-point-calculations-so-inaccurate -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14389

[issue14228] It is impossible to catch sigint on startup in python code

2012-03-22 Thread poq
poq p...@gmx.com added the comment: It seems not even using -S fixes the problem That's because you try to use re and os in your except block, and the KeyboardInterrupt is raised before they are imported. -- nosy: +poq ___ Python tracker

[issue14367] try/except block in ismethoddescriptor() in inspect.py, so that pydoc works with pygame in Python 3.2

2012-03-22 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Michael, I thought you might be interested in this one since it looks like it might involve inspect executing code unexpectedly, and I know you worked on ways of not doing that... -- nosy: +michael.foord

[issue10538] PyArg_ParseTuple(s*) does not always incref object

2012-03-22 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Adding a patch here. -- keywords: +patch Added file: http://bugs.python.org/file24995/#10538.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10538

[issue14389] Mishandling of large numbers

2012-03-22 Thread R. David Murray
Changes by R. David Murray rdmur...@bitdance.com: -- resolution: - invalid stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14389 ___

[issue14228] It is impossible to catch sigint on startup in python code

2012-03-22 Thread telmich
telmich nico-bugs.python@schottelius.org added the comment: Oh yes, you are right. Sorry for the confusion. When modifying caller.py to only print(), everything works. But then I've a different problem: If I want to exit(1), in case I get a SIGINT, I'd like to try to import sys. But trying

[issue14307] Make subclassing SocketServer simpler for non-blocking frameworks

2012-03-22 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: What's wrong with making functionality overridable, Antoine? By all means, let's keep the select() but allow subclasses to elect not to use it. As for the wakeup fd, there isn't such a thing. Why object on the basis of a

  1   2   >