Re: Commutative object in emulating numbers

2009-09-13 Thread Steven D'Aprano
On Sun, 13 Sep 2009 21:52:26 -0700, iu2 wrote: Hi, I reached the chapter Emulating numeric types in the python documentation and I tried this: [...] What do I need to do in order to make the two classes, int and A, commutative? Try adding a __rmul__ method: class A: def

Re: Why use locals()

2009-09-13 Thread Carl Banks
On Sep 13, 10:15 pm, Carl Banks pavlovevide...@gmail.com wrote: Gabrielle's Whoops, very sorry about that typo, just how it rolled of the fingers. Ugh. Carl Banks -- http://mail.python.org/mailman/listinfo/python-list

Re: Why use locals()

2009-09-13 Thread Sean DiZazzo
If you are willing to open your mind to the possibility that some Pythonic things don't adhere to every Zen, then I would suggest that Gabrielle's examples are perfectly Pythonic shortcuts.  But if you don't want to use them, you don't have to, nobody is forcing you. It's a pretty small

[issue6899] Base.replace breaks tree

2009-09-13 Thread Martin v . Löwis
New submission from Martin v. Löwis mar...@v.loewis.de: In Base.replace, the method checks that self.parent is not None - however, it (unfortunately), breaks this very property itself if self is new, or self in new. In particular, some fixers return node from transform if they don't want to

[issue6713] Integer Long types: Performance improvement of 1.6x to 2x for base 10 conversions

2009-09-13 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Barring objections, I plan to apply the 'long_decimal_conversion_py3k' patch to the py3k branch; I'll then backport to trunk. This patch doesn't include Gawain's two-decimal-digits-at-a-time optimization; after I've applied the patch,

[issue6713] Integer Long types: Performance improvement of 1.6x to 2x for base 10 conversions

2009-09-13 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6713 ___ ___

[issue6900] Sub-optimal Locate button behaviour in Windows CHM file

2009-09-13 Thread Tom Seddon
New submission from Tom Seddon bugs.python@tomseddon.plus.com: Behaviour of Locate in latest Windows CHM file for Python 2.6.2 is sub-optimal. I first spotted this with the optparse module, so this bug refers to the optparse module. It looks as if this is a global problem, though. First,

[issue6899] Base.replace breaks tree

2009-09-13 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: Looks good, but it needs some tests. -- nosy: +benjamin.peterson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6899 ___

[issue6499] Can't import xmlrpclib, DocXMLRPCServer and SimpleXMLRPCServer when zlib is not available

2009-09-13 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Ok, this means that the exception is raised after the finally, when the thread is exiting. Now, at this point the process is exiting and therefore we have trouble printing the exception. (this is probably also the cause of the

[issue6108] unicode(exception) behaves differently on Py2.6 when len(exception.args) 1

2009-09-13 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Looks like a potentially annoying bug to me. -- nosy: +pitrou priority: - high stage: - needs patch versions: +Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6108

[issue6635] Profiler doesn't print usage (indexError instead)

2009-09-13 Thread Matthias Klose
Matthias Klose d...@debian.org added the comment: fixed in 2.6, 2.7, 3.1, 3.2 -- nosy: +doko resolution: - fixed status: open - closed versions: +Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6635

[issue6301] Error in tutorial section 7.2

2009-09-13 Thread Michael Foord
Michael Foord mich...@voidspace.org.uk added the comment: Committed revision 74779. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6301 ___ ___

[issue6882] uuid creates zombies

2009-09-13 Thread Eric Smith
Changes by Eric Smith e...@trueblade.com: -- stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6882 ___ ___ Python-bugs-list

[issue6882] uuid creates zombies

2009-09-13 Thread Eric Smith
Changes by Eric Smith e...@trueblade.com: -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6882 ___ ___ Python-bugs-list mailing

[issue6567] Make inf be almost equal to inf

2009-09-13 Thread Michael Foord
Michael Foord mich...@voidspace.org.uk added the comment: Committed revision 74780. -- resolution: wont fix - accepted status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6567

[issue6712] sys._getframe is not available on all Python implementations

2009-09-13 Thread Michael Foord
Michael Foord mich...@voidspace.org.uk added the comment: Committed revision 74781. -- resolution: - accepted status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6712 ___

[issue5135] Expose simplegeneric function in functools module

2009-09-13 Thread Guido van Rossum
Guido van Rossum gu...@python.org added the comment: Please don't introduce this without a PEP. -- nosy: +gvanrossum ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5135 ___

[issue6849] Tutorial changes

2009-09-13 Thread Michael Foord
Michael Foord mich...@voidspace.org.uk added the comment: Committed revision 74782. -- resolution: - accepted status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6849 ___

[issue6866] TestLoader.loadTestsFromName does not use suiteClass attribute to create TestSuite instances

2009-09-13 Thread Michael Foord
Michael Foord mich...@voidspace.org.uk added the comment: Committed revision 74783. -- resolution: - accepted status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6866 ___

[issue6901] Runaway programs often become unresponsive to CTRL-C

2009-09-13 Thread Bernie H. Innocenti
New submission from Bernie H. Innocenti ber...@codewiz.org: On startup, the Python interpreter changes the default behavior of SIGINT, which results in many Python programs to ignore the keyboard interrupt exactly in the situations when users are most likely to use it (i.e.: when the program

[issue6901] Runaway programs often become unresponsive to CTRL-C

2009-09-13 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: This is a fundemental behavior that will never change. If you dislike it, you can remove the signal handler for it with the signal module. -- nosy: +benjamin.peterson resolution: - works for me status: open - closed

[issue6871] decimal.py: more format issues

2009-09-13 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: I think issue #4 is a bug in float formatting: I don't think it makes sense to change alignment just because the fill character happens to be '0'. -- ___ Python tracker rep...@bugs.python.org

[issue6871] decimal.py: more format issues

2009-09-13 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: From the current trunk: format(float('1e88'), '120') '1e+88111' [64734 refs] format(float('1e88'), '020') '0001e+88' [64734 refs] -- ___ Python tracker

[issue6901] Runaway programs often become unresponsive to CTRL-C

2009-09-13 Thread Bernie H. Innocenti
Bernie H. Innocenti ber...@codewiz.org added the comment: This is a fundemental behavior that will never change. If you dislike it, you can remove the signal handler for it with the signal module. What? We could break the syntax of print statements and cannot change this minor detail that

[issue6901] Runaway programs often become unresponsive to CTRL-C

2009-09-13 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: Regardless of whether this is a good idea or not, it's too broad a change for the bug tracker. Please bring it up on python-ideas if you wish to pursue the topic. -- ___ Python tracker

[issue6901] Runaway programs often become unresponsive to CTRL-C

2009-09-13 Thread Bernie H. Innocenti
Bernie H. Innocenti ber...@codewiz.org added the comment: Ok -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6901 ___ ___ Python-bugs-list

[issue6568] unittest test discovery improvements

2009-09-13 Thread Michael Foord
Michael Foord mich...@voidspace.org.uk added the comment: Committed revision 74785. -- resolution: - accepted status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6568 ___

[issue6713] Integer Long types: Performance improvement of 1.6x to 2x for base 10 conversions

2009-09-13 Thread Gawain Bolton
Gawain Bolton gp.bol...@computer.org added the comment: Mark, I haven't tried your latest patch but I tried your patch3 and obtained the same performance improvement for long integers, namely 3.1x faster. This is truly an excellent improvement, my hat's off to you! As for the basic integers,

[issue6902] Built-in types format incorrectly with 0 padding.

2009-09-13 Thread Eric Smith
New submission from Eric Smith e...@trueblade.com: Originally discussed in issue 6871. Even if an alignment of is specified, = is used if the padding character is 0. format(2, '020') '0002' format(2, '120') '2111' This is a problem for at least float and

[issue6871] decimal.py: more format issues

2009-09-13 Thread Eric Smith
Eric Smith e...@trueblade.com added the comment: Created issue 6902 to handle #4. The others will need to be broken out into their own issues if we want to fix them. I can't keep track of multiple issues in one bug report. -- ___ Python tracker

[issue6903] pdb - print in for iteration prints None after printing

2009-09-13 Thread Mitchell Model
New submission from Mitchell Model m...@acm.org: Near the bottom of the library documentation for pdb there is an example of a very useful alias: alias pi for k in %1.__dict__.keys(): print(%1.,k,=,%1.__dict__[k]) It turns out that doing print in a for loop in pdb results in None being printed

[issue6904] Broken URL for pyqt

2009-09-13 Thread Thijs Triemstra
New submission from Thijs Triemstra li...@collab.nl: using/mac.html#gui-programming-on-the-mac refers to http://www.riverbankcomputing.co.uk/pyqt/ but this should be http://www.riverbankcomputing.co.uk/software/pyqt -- assignee: georg.brandl components: Documentation messages: 92589

[issue6904] Broken URL for pyqt

2009-09-13 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- assignee: georg.brandl - ezio.melotti nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6904 ___

[issue6904] Broken URL for pyqt

2009-09-13 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: Fixed in r74787 (trunk) and r74788 (py3k), thanks! -- priority: - low resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org

[issue6905] inspect.getargspec(print) fails

2009-09-13 Thread Yuv Gre
New submission from Yuv Gre ubershme...@gmail.com: import inspect inspect.getargspec(print) Traceback (most recent call last): File stdin, line 1, in module File F:\Python31\lib\inspect.py, line 787, in getargspec getfullargspec(func) File F:\Python31\lib\inspect.py, line 814, in

<    1   2