Re: Decimal 0**0

2013-02-07 Thread Terry Reedy
On 2/7/2013 12:47 AM, Tim Roberts wrote: Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Does anyone have an explanation why Decimal 0**0 behaves so differently from float 0**0? ... I am familiar with the arguments for treating 0**0 as 0, or undefined, but thought that except for

Re: puzzled by name binding in local function

2013-02-07 Thread Ulrich Eckhardt
Heureka! Am 06.02.2013 15:37, schrieb Dave Angel: def myfunc2(i): def myfunc2b(): print (myfunc2 is using, i) return myfunc2b Earlier you wrote: There is only one instance of i, so it's not clear what you expect. Since it's not an argument to test(), it has to be found in

Re: Plotting syntax

2013-02-07 Thread Jean-Michel Pichavant
- Original Message - Hi Python experts, I am working with an array of data and am trying to plot several columns of data which are not continuous; i.e. I would like to plot columns 1:4 and 6:8, without plotting column 5. The syntax I am currently using is: oplot (t,d[:,0:4]) The

Re: Random and fork

2013-02-07 Thread Julien Le Goff
Thank you for the answers! It was much simpler than I thought. On Wednesday, 6 February 2013 17:49:06 UTC+1, Alain Ketterlin wrote: Julien Le Goff julien.leg...@gmail.com writes: Today I came accross a behaviour I did not expect in python (I am using 2.7). In my program,

Re: Curious to see alternate approach on a search/replace via regex

2013-02-07 Thread Peter Otten
rh wrote: I am curious to know if others would have done this differently. And if so how so? This converts a url to a more easily managed filename, stripping the http protocol off. This: http://alongnameofasite1234567.com/q?sports=runa=1b=1 becomes this:

Re: Plotting syntax

2013-02-07 Thread Oscar Benjamin
On 7 February 2013 09:37, Jean-Michel Pichavant jeanmic...@sequans.com wrote: - Original Message - Hi Python experts, I am working with an array of data and am trying to plot several columns of data which are not continuous; i.e. I would like to plot columns 1:4 and 6:8, without

Re: Monitoring updating directory for image for GUI

2013-02-07 Thread Alain Ketterlin
ciscorucin...@gmail.com writes: Basically I am creating a program that will stream musical notes into a program called Lilypond one-by-one and it will create the sheet music for that stream of music via OS command. Your understanding of Lilypond is not needed, but you need to know that for

Re: Curious to see alternate approach on a search/replace via regex

2013-02-07 Thread jmfauth
On 7 fév, 04:04, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: On Wed, 06 Feb 2013 13:55:58 -0800, Demian Brecht wrote: Well, an alternative /could/ be: ... py s = 'http://alongnameofasite1234567.com/q?sports=runa=1b=1' py assert u2f(s) == mangle(s) py py from timeit import

Re: Improve reduce functions of SQLite3 request

2013-02-07 Thread Steffen Mutter
Hi Dennis, I really appreciate your input :-) Dennis Lee Bieber wrote: I'll confess that I've not looked at any such sites -- mainly because I wouldn't understand enough about the sport to understand why one would do something one way or another. You better do not. The first one I had

Re: Curious to see alternate approach on a search/replace via regex

2013-02-07 Thread Chris Angelico
On Thu, Feb 7, 2013 at 10:08 PM, jmfauth wxjmfa...@gmail.com wrote: The future is bright for ... ascii users. jmf So you're admitting to being not very bright? *ducks* Seriously jmf, please don't hijack threads just to whine about contrived issues of Unicode performance yet again. That horse

Re: select.epoll question

2013-02-07 Thread Chris Angelico
On Thu, Feb 7, 2013 at 6:08 PM, Paul Rubin no.email@nospam.invalid wrote: Any idea of a good way to map the file descriptors back to socket objects? Is there some kind of hidden interface that I don't know about, that gives back sockets directly? I don't know of any, but you can get the file

Re: Curious to see alternate approach on a search/replace via regex

2013-02-07 Thread Nick Mellor
Hi RH, translate methods might be faster (and a little easier to read) for your use case. Just precompute and re-use the translation table punct_flatten. Note that the translate method has changed somewhat for Python 3 due to the separation of text from bytes. The is a Python 3 version. from

Re: Random and fork

2013-02-07 Thread Stephane Wirtel
* Julien Le Goff julien.leg...@gmail.com [2013-02-06 08:28:24 -0800]: Hi everyone, Today I came accross a behaviour I did not expect in python (I am using 2.7). In my program, random.random() always seemed to return the same number; it turned out to be related to the fact that I was using

RE: Help about finding a python script on geographic masking

2013-02-07 Thread tkhan10
Thank you for your reply. Actually I wanted to post it on the list but didn't notice that it went only to your email. For the shape file part: yes I have a sample patients' data in a shape file with the patients' address locations (where the lat/long for the addresses are available) and

Re: Curious to see alternate approach on a search/replace via regex

2013-02-07 Thread Demian Brecht
On 2013-02-06 7:04 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: I dispute those results. I think you are mostly measuring the time to print the result, and I/O is quite slow. Good call, hadn't even considered that. My tests show that using urlparse is 33% faster than using

sub-classing datetime

2013-02-07 Thread Colin J. Williams
I'm just making the transition from 2 to 3 for one module. With Python 2.7, I had the benefit of mx datetime, but this is not yet available for Python 3.2. I find that the 3.2 datetime is not subclassable, for reasons that were known some years back. It would help if there was a note in

Re: select.epoll question

2013-02-07 Thread Paul Rubin
Chris Angelico ros...@gmail.com writes: fd_to_sock={sock.fileno():sock for sock in list_of_sockets} You'd need to manually maintain that as sockets get created/destroyed, though Thanks, I was hoping to avoid that. I'll have to check how select.select manages to return sockets. Maybe it

Re: select.epoll question

2013-02-07 Thread Chris Angelico
On Fri, Feb 8, 2013 at 3:15 AM, Paul Rubin no.email@nospam.invalid wrote: Chris Angelico ros...@gmail.com writes: fd_to_sock={sock.fileno():sock for sock in list_of_sockets} You'd need to manually maintain that as sockets get created/destroyed, though Thanks, I was hoping to avoid that.

Re: Curious to see alternate approach on a search/replace via regex

2013-02-07 Thread Serhiy Storchaka
On 07.02.13 11:49, Peter Otten wrote: ILLEGAL = -:./?= try: TRANS = string.maketrans(ILLEGAL, _ * len(ILLEGAL)) except AttributeError: # python 3 TRANS = dict.fromkeys(map(ord, ILLEGAL), _) str.maketrans() -- http://mail.python.org/mailman/listinfo/python-list

Re: Monitoring updating directory for image for GUI

2013-02-07 Thread Piet van Oostrum
ciscorucin...@gmail.com writes: Hello, I have been using Python for a few months now, so I am still learning a few things here and there. Basically I am creating a program that will stream musical notes into a program called Lilypond one-by-one and it will create the sheet music for

Re: sub-classing datetime

2013-02-07 Thread marduk
On Thu, Feb 7, 2013, at 10:13 AM, Colin J. Williams wrote: I'm just making the transition from 2 to 3 for one module. With Python 2.7, I had the benefit of mx datetime, but this is not yet available for Python 3.2. I find that the 3.2 datetime is not subclassable, for reasons that were

Forward Backward Algorithm in Python

2013-02-07 Thread subhabangalore
Dear Group, If any one can kindly help me with a simple Forward Backward algorithm implementation. I tried to search in web but did not help much. Thanking You in Advance, Regards, Subhabrata. -- http://mail.python.org/mailman/listinfo/python-list

Re: 2013 Collection Of Solution Manuals Test Banks. More Than 15,000 Titles

2013-02-07 Thread TestBank
= Contact : REQUEST(at)TESTBANKLIST(dot)COM Website: TESTBANKLIST(dot)COM http://testbanklist.com == Western Civilization: Beyond

Re: select.epoll question

2013-02-07 Thread Paul Rubin
Chris Angelico ros...@gmail.com writes: Yeah, I figured fileno() probably wouldn't be news to you. I don't suppose there's anything convenient in the rest of your application that makes such a list/dict plausible? In fact it's rather annoying, sockets are created and destroyed in multiple

Re: Forward Backward Algorithm in Python

2013-02-07 Thread Dave Angel
On 02/07/2013 03:13 PM, subhabangal...@gmail.com wrote: Dear Group, If any one can kindly help me with a simple Forward Backward algorithm implementation. I tried to search in web but did not help much. Thanking You in Advance, Regards, Subhabrata. No idea what forward-backward-algorithm

Parsing XML RSS feed byte stream for item tag

2013-02-07 Thread darrel . rendell
I'm attempting to parse an RSS feed for the first instance of an element . def pageReader(url): try: readPage = urllib2.urlopen(url) except urllib2.URLError, e: # print 'We failed to reach a server.' # print 'Reason: ', e.reason return 404 except urllib2.HTTPError, e: #

Re: Parsing XML RSS feed byte stream for item tag

2013-02-07 Thread John Gordon
In 16828a11-6c7c-4ab6-b406-6b8819883...@googlegroups.com darrel.rend...@gmail.com writes: def pageReader(url): try: readPage =3D urllib2.urlopen(url) except urllib2.URLError, e: # print 'We failed to reach a server.' # print 'Reason: ', e.reason return 404 =20 except

Re: urllib2 FTP Weirdness

2013-02-07 Thread Cameron Simpson
On 07Feb2013 02:43, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: | On Thu, 07 Feb 2013 10:06:32 +1100, Cameron Simpson wrote: | Timing. (Let me say I consider this scenario unlikely, very unlikely. | But...) | If the latter is consistently slightly slower | | On my laptop, the

Re: Curious to see alternate approach on a search/replace via regex

2013-02-07 Thread Steven D'Aprano
rh wrote: I am using 2.7.3 and I put the re.compile outside the function and it performed faster than urlparse. I don't print out the data. I find that hard to believe. re.compile caches its results, so except for the very first time it is called, it is very fast -- basically a function call

Re: Opinion on best practice...

2013-02-07 Thread Steven D'Aprano
Chris Angelico wrote: On Thu, Feb 7, 2013 at 5:50 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Thu, 07 Feb 2013 16:28:17 +1100, Chris Angelico wrote: You misunderstand. It's actually a very simple rule. Python follows C's principle of accepting that any return value

Re: Improve reduce functions of SQLite3 request

2013-02-07 Thread Steffen Mutter
Dennis Lee Bieber wrote: On Thu, 7 Feb 2013 11:33:00 + (UTC), Steffen Mutter stef...@webanimations.de declaimed the following in gmane.comp.python.general: CREATE TABLE Runde20122013 ( Is that table name specifying a playing season? Yes. What happens next season -- you create

Re: Opinion on best practice...

2013-02-07 Thread Steven D'Aprano
Dennis Lee Bieber wrote: Line 3 has unquoted echo which is not a REXX command; it is considered an external command and is passed the /result/ of calling REXX time() -- where Windows executes it Good lord, that's even worse than I feared. So it's not just unparsable non-REXX code that is

Moving mouse, Python3 and PyObjc

2013-02-07 Thread joaofguiomar
import objc def clickMouse(x, y, button): bndl = objc.loadBundle('CoreGraphics', globals(), '/System/Library/Frameworks/ApplicationServices.framework') objc.loadBundleFunctions(bndl, globals(), [('CGPostMouseEvent', 'v{CGPoint=ff}III')]) CGPostMouseEvent((x, y), 1, button, 1)

Re: Decimal 0**0

2013-02-07 Thread Steven D'Aprano
Tim Roberts wrote: Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Does anyone have an explanation why Decimal 0**0 behaves so differently from float 0**0? ... I am familiar with the arguments for treating 0**0 as 0, or undefined, but thought that except for specialist use-cases, it

Re: Curious to see alternate approach on a search/replace via regex

2013-02-07 Thread Steven D'Aprano
rh wrote: On Fri, 08 Feb 2013 09:45:41 +1100 Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: rh wrote: I am using 2.7.3 and I put the re.compile outside the function and it performed faster than urlparse. I don't print out the data. I find that hard to believe.

Re: Monitoring updating directory for image for GUI

2013-02-07 Thread ciscorucinski
Real-time...as close to real-time as possible. That is why I did not really want to use a queue. That is because if a bunch of the thread that create the images finish really close to one another (when they should be spread out based on how the music is played), then there would be a larger lag

Re: Moving mouse, Python3 and PyObjc

2013-02-07 Thread Terry Reedy
On 2/7/2013 6:22 PM, joaofguio...@gmail.com wrote: import objc def clickMouse(x, y, button): bndl = objc.loadBundle('CoreGraphics', globals(), '/System/Library/Frameworks/ApplicationServices.framework') objc.loadBundleFunctions(bndl, globals(), [('CGPostMouseEvent', 'v{CGPoint=ff}III')])

Re: Curious to see alternate approach on a search/replace via regex

2013-02-07 Thread Ian Kelly
On Thu, Feb 7, 2013 at 5:55 PM, Ian Kelly ian.g.ke...@gmail.com wrote: Whatever caching is being done by re.compile, that's still a 24% savings by moving the compile calls into the setup. On the other hand, if you add an re.purge() call to the start of t1 to clear the cache: t3 = Timer( ...

Re: len() on mutables vs. immutables

2013-02-07 Thread Demian Brecht
So, it's taken me a little while longer than I figured to actually get the time to dig around for the question that I had (added to the bottom of this message for context).. Pretty mundane stuff, but I did the digging (3.4.0a). Hopefully the results will help anyone else with the same questions.

Re: Monitoring updating directory for image for GUI

2013-02-07 Thread Oscar Benjamin
On 8 February 2013 00:48, ciscorucin...@gmail.com wrote: Real-time...as close to real-time as possible. That is why I did not really want to use a queue. That is because if a bunch of the thread that create the images finish really close to one another (when they should be spread out based

Re: select.epoll question

2013-02-07 Thread Kushal Kumaran
Paul Rubin no.email@nospam.invalid writes: Chris Angelico ros...@gmail.com writes: Yeah, I figured fileno() probably wouldn't be news to you. I don't suppose there's anything convenient in the rest of your application that makes such a list/dict plausible? In fact it's rather annoying,

Re: Moving mouse, Python3 and PyObjc

2013-02-07 Thread Dave Angel
On 02/07/2013 06:22 PM, joaofguio...@gmail.com wrote: import objc def clickMouse(x, y, button): bndl = objc.loadBundle('CoreGraphics', globals(), '/System/Library/Frameworks/ApplicationServices.framework') objc.loadBundleFunctions(bndl, globals(), [('CGPostMouseEvent',

Re: best way to share an instance of a class among modules?

2013-02-07 Thread Rick Johnson
On Wednesday, February 6, 2013 7:36:28 PM UTC-6, Ethan Furman wrote: As Michael Torrie pointed out, the 'global' keyword is needed: Wrong. The global keyword is in fact NOT needed and something i consider to be another wart of the language (PyWart on this subject coming soon!). Now, whilst

Re: Curious to see alternate approach on a search/replace via regex

2013-02-07 Thread Steven D'Aprano
Ian Kelly wrote: On Thu, Feb 7, 2013 at 4:59 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Oh, one last thing... pulling out re.compile outside of the function does absolutely nothing. You don't even compile anything. It basically looks up that a compile function exists in

Re: len() on mutables vs. immutables

2013-02-07 Thread Terry Reedy
On 2/7/2013 8:09 PM, Demian Brecht wrote: http://demianbrecht.github.com/posts/2013/02/07/understanding-len/ When len() is called passing an immutable built-in type (such as a string), I'd assume that the overhead in doing so is simply a function call and there are no on-call calculations

which situations should we use thread. join() ?

2013-02-07 Thread iMath
which situations should we use thread. join() ? http://bpaste.net/show/yBDGfrlU7BDDpvEZEHmo/ why do we not put thread. join() in this code ? -- http://mail.python.org/mailman/listinfo/python-list

PyWart: Namespace asinitiy and the folly of the global statement

2013-02-07 Thread Rick Johnson
Python's use of namespaces is, as we all quite know, one honking great idea!; and i must wholeheartedly agree, however, accessing and declaring variables living in python namespaces is a kludge at best, and a malevolent obfuscation at worst!

Re: Forward Backward Algorithm in Python

2013-02-07 Thread subhabangalore
On Friday, February 8, 2013 2:08:35 AM UTC+5:30, Dave Angel wrote: On 02/07/2013 03:13 PM, subhabangal...@gmail.com wrote: Dear Group, If any one can kindly help me with a simple Forward Backward algorithm implementation. I tried to search in web but did not help much. Thanking

Re: Forward Backward Algorithm in Python

2013-02-07 Thread xDog Walker
On Thursday 2013 February 07 12:38, Dave Angel wrote: On 02/07/2013 03:13 PM, subhabangal...@gmail.com wrote: Dear Group, If any one can kindly help me with a simple Forward Backward algorithm implementation. I tried to search in web but did not help much. Thanking You in Advance,

Re: Parsing XML RSS feed byte stream for item tag

2013-02-07 Thread xDog Walker
On Thursday 2013 February 07 12:36, darrel.rend...@gmail.com wrote: As I've said, BeautifulSoup fails to find both pubDate and Link, which are crucial to my app Any advice would be greatly appreciated. http://packages.python.org/feedparser -- Yonder nor sorghum stenches shut ladle gulls

Re: Implicit conversion to boolean in if and while statements

2013-02-07 Thread Rick Johnson
On Monday, July 16, 2012 7:43:47 PM UTC-5, Steven D'Aprano wrote: [...] If I insist on making a single object do duty for both the jar and the jellybean count, then I need a null jar object, and I probably end up with something like this: Jar(number_of_beans=None) = null jar object

Re: Implicit conversion to boolean in if and while statements

2013-02-07 Thread Rick Johnson
On Monday, July 16, 2012 8:45:51 PM UTC-5, rusi wrote: On Jul 15, 9:50 pm, Rick Johnson rantingrickjohn...@gmail.com wrote: I think this issue is not so much a bool test vs type test, but more an ambiguous syntax issue. If you know some English, its clear that if and while create bool

multi-result set MySQLdb queries.

2013-02-07 Thread Andrew Robinson
Hi, I'm being forced to use import MySQLdb to access a serverand am not getting all my data back. I'm trying to send multiple queries all at once (for time reasons) and then extract the rows in bulk. The queries have different number of columns; For a contrived example; script.db.query(

Re: best way to share an instance of a class among modules?

2013-02-07 Thread Michael Torrie
On 02/07/2013 07:14 PM, Rick Johnson wrote: On Wednesday, February 6, 2013 7:36:28 PM UTC-6, Ethan Furman wrote: As Michael Torrie pointed out, the 'global' keyword is needed: Wrong. The global keyword is in fact NOT needed and something i consider to be another wart of the language (PyWart

Re: Implicit conversion to boolean in if and while statements

2013-02-07 Thread Chris Angelico
On Fri, Feb 8, 2013 at 4:53 PM, Rick Johnson rantingrickjohn...@gmail.com wrote: And which Univeristy would you recommend for studying the intricacies of gobbledygook? ;-) Dunno, where'd you get your degree in logic? *dives for cover* ChrisA --

Re: Implicit conversion to boolean in if and while statements

2013-02-07 Thread Rick Johnson
On Monday, July 16, 2012 11:18:28 PM UTC-5, Devin Jeanpierre wrote: On Mon, Jul 16, 2012 at 12:03 AM, Steven D'Aprano wrote: On Sun, 15 Jul 2012 22:15:13 -0400, Devin Jeanpierre wrote: For example, instead of if stack: or if bool(stack):, we could use if stack.isempty():. This line tells

Re: PyWart: Namespace asinitiy and the folly of the global statement

2013-02-07 Thread Michael Torrie
On 02/07/2013 09:30 PM, Rick Johnson wrote: count = 0 class Blah: def meth(): for x in range(100): count = x Where is count living? Of course in this simplistic example we can see that count is @ module level Except that it's not after the count=x

Re: Implicit conversion to boolean in if and while statements

2013-02-07 Thread Rick Johnson
On Tuesday, July 17, 2012 8:35:09 PM UTC-5, alex23 wrote: On Jul 17, 6:23 pm, Andrew Berg bahamutzero8...@gmail.com wrote: On 7/17/2012 2:08 AM, Steven D'Aprano wrote: The default behaviour is that every object is something, hence true-like, unless explicitly coded to be treated as

Re: PyWart: Namespace asinitiy and the folly of the global statement

2013-02-07 Thread Chris Angelico
On Fri, Feb 8, 2013 at 3:30 PM, Rick Johnson rantingrickjohn...@gmail.com wrote: It is my strong opinion that all unqualified variables must be local to the containing block, func/meth, class, or module. To access any variable outside of the local scope a programmer MUST qualify that variable

memoryview (was len() on mutables vs. immutables)

2013-02-07 Thread Demian Brecht
On 2013-02-07 8:30 PM, Terry Reedy tjre...@udel.edu wrote: So you may assume I've been bitten far too many times by incorrect assumptions about implementations that ended up actually doing something quite silly. Having said that, I felt fairly safe in making that assumption with Python, but

Re: Implicit conversion to boolean in if and while statements

2013-02-07 Thread Michael Torrie
On 02/07/2013 11:16 PM, Rick Johnson wrote: He is so accustomed to guessing that it has become second nature for him. I think most of us are guessing as to what you're talking about since you're responding to a 7 month old thread that I think most people have long since deleted from their

Re: which situations should we use thread. join() ?

2013-02-07 Thread Chris Angelico
On Fri, Feb 8, 2013 at 3:32 PM, iMath redstone-c...@163.com wrote: which situations should we use thread. join() ? http://bpaste.net/show/yBDGfrlU7BDDpvEZEHmo/ why do we not put thread. join() in this code ? I've no idea why you don't put thread.join() in that code. Maybe because it isn't

Re: Curious to see alternate approach on a search/replace via regex

2013-02-07 Thread Dave Angel
On 02/07/2013 06:13 PM, rh wrote: On Fri, 08 Feb 2013 09:45:41 +1100 Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: snip But since you don't demonstrate any actual working code, you could be correct, or you could be timing it wrong. Without seeing your timing code, my guess is

Re: Implicit conversion to boolean in if and while statements

2013-02-07 Thread Rick Johnson
On Tuesday, July 17, 2012 8:35:09 PM UTC-5, alex23 wrote: On Jul 17, 6:23 pm, Andrew Berg bahamutzero8...@gmail.com wrote: On 7/17/2012 2:08 AM, Steven D'Aprano wrote: The default behaviour is that every object is something, hence true-like, unless explicitly coded to be treated as

Re: Implicit conversion to boolean in if and while statements

2013-02-07 Thread Rick Johnson
On Friday, February 8, 2013 12:27:09 AM UTC-6, Michael Torrie wrote: On 02/07/2013 11:16 PM, Rick Johnson wrote: He is so accustomed to guessing that it has become second nature for him. I think most of us are guessing as to what you're talking about since you're responding to a 7 month

Re: PyWart: Namespace asinitiy and the folly of the global statement

2013-02-07 Thread Rick Johnson
On Friday, February 8, 2013 12:25:34 AM UTC-6, Chris Angelico wrote: On Fri, Feb 8, 2013 at 3:30 PM, Rick Johnson wrote: It is my strong opinion that all unqualified variables must be local to the containing block, func/meth, class, or module. To access any variable outside of the local

Re: Implicit conversion to boolean in if and while statements

2013-02-07 Thread Steven D'Aprano
Rick Johnson wrote: Why even have a damn bool function if you're never going to use it? bool is for converting arbitrary objects into a canonical True or False flag. E.g. one use-case is if you wish to record in permanent storage a flag, and don't want arbitrary (possibly expensive) objects to

Re: PyWart: Namespace asinitiy and the folly of the global statement

2013-02-07 Thread Chris Angelico
On Fri, Feb 8, 2013 at 6:23 PM, Rick Johnson rantingrickjohn...@gmail.com wrote: from builtins import print, len, repr from builtins import * # This is not recommended! This would serve two purposes (1) the reader would know which builtins where being used in this module (2) the

[issue17047] Fix double double words words

2013-02-07 Thread Terry J. Reedy
Terry J. Reedy added the comment: Lib/tkinter/tix.py:1920 Val may be: auto -- the width of the column is set the the widest cell in the column; a valid Tk screen distance I believe 'the the' should be 'to the width of the' Lib/tkinter/tix.py:1944 Val may be: auto -- the height of the row

[issue12768] docstrings for the threading module

2013-02-07 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12768 ___

[issue4331] Can't use _functools.partial() created function as method

2013-02-07 Thread Ulrich Eckhardt
Ulrich Eckhardt added the comment: Just for the record, the behaviour is documented, unfortunately in the very last line of the functools documentation: Also, partial objects defined in classes behave like static methods and do not transform into bound methods during instance attribute

[issue17069] HTTP result code in urllib2.urlopen() file object undocumented

2013-02-07 Thread Senthil Kumaran
Senthil Kumaran added the comment: I shall go ahead with this change. And when the URLopener and FancyURLopener removed, all their references in the docs (including this change) will be removed. -- ___ Python tracker rep...@bugs.python.org

[issue17069] HTTP result code in urllib2.urlopen() file object undocumented

2013-02-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset fae8e212e870 by Senthil Kumaran in branch '3.2': Fix Issue17069: Document getcode method in urllib.request.rst http://hg.python.org/cpython/rev/fae8e212e870 New changeset e15d2ad42d93 by Senthil Kumaran in branch '3.3': Fix Issue17069: Document

[issue17069] HTTP result code in urllib2.urlopen() file object undocumented

2013-02-07 Thread Senthil Kumaran
Changes by Senthil Kumaran sent...@uthcode.com: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17069 ___

[issue17069] HTTP result code in urllib2.urlopen() file object undocumented

2013-02-07 Thread Ezio Melotti
Ezio Melotti added the comment: Are these the addinfourl getters that Ezio wants to deprecate? Yes, see #12707 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17069 ___

[issue12596] cPickle - stored data differ for same dictionary

2013-02-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: As soon as hash randomization is turned on (and it's the default starting with Python 3.3), the pickled representation of dicts will also vary from run to run: $ python -R -c import pickle; print pickle.dumps({'a':1, 'b':2}) |md5sum

[issue16800] tempfile._get_default_tempdir() leaves files behind when HD is full

2013-02-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: There are reasons to use buffered I/O rather than os.write: os.write can fail with EINTR, for example. -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16800

[issue17149] random.vonmisesvariate() returns a value only on the half-circle

2013-02-07 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17149 ___ ___ Python-bugs-list

[issue17149] random.vonmisesvariate() returns a value only on the half-circle

2013-02-07 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: random.vonmisesvariate(mu, kappa) returns a value in the range (mu%2pi)-pi/2 to (mu%2pi)+pi/2 for kappa 1e-6. For kappa = 1e-6 it returns an uniform random value over the range 0 to 2*pi. -- components: Library (Lib) messages: 181588 nosy:

[issue17143] trace.py uses _warn without importing it

2013-02-07 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- stage: - patch review type: - behavior versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17143 ___

[issue13655] Python SSL stack doesn't have a default CA Store

2013-02-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: Éric's suggestion is also implemented in python-requests if I remember correctly. It allows for user-specified PEM files and tries to find the operating system bundle. This would be a wonderful inclusion in the standard library. Aren't

[issue17149] random.vonmisesvariate() returns a value only on the half-circle

2013-02-07 Thread Mark Dickinson
Mark Dickinson added the comment: I'll take a look at this. -- assignee: - mark.dickinson nosy: +mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17149 ___

[issue17144] Distutils: sdist register upload ignores -r argument

2013-02-07 Thread Danilo Bargen
Danilo Bargen added the comment: chris, no, that command registers the package with the local index but tries to upload it to pypi. What works is setup.py sdist register -r wbrp upload -r wbrp but that's kind of awful. -- ___ Python tracker

[issue9253] argparse: optional subparsers

2013-02-07 Thread Bohuslav Slavek Kabrda
Changes by Bohuslav Slavek Kabrda bkab...@redhat.com: -- nosy: +bkabrda ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9253 ___ ___

[issue6083] Reference counting bug in PyArg_ParseTuple and PyArg_ParseTupleAndKeywords

2013-02-07 Thread Stefan Krah
Stefan Krah added the comment: The FreeBSD 6.4 bot is failing, too. Note that the other functions in test_returnfuncptrs.py do this in order to get strchr(): dll = CDLL(_ctypes_test.__file__) get_strchr = dll.get_strchr get_strchr.restype = CFUNCTYPE(c_char_p, c_char_p, c_char)

[issue17141] random.vonmisesvariate() hangs for large kappa

2013-02-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is an implementation which is more precise for small and large kappa, doesn't hang for large kappa, and even a little faster. It is mathematically totally equivalent to existing, but use more accurate calculations. -- keywords: +patch Added

[issue17141] random.vonmisesvariate() hangs for large kappa

2013-02-07 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- stage: needs patch - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17141 ___ ___

[issue12596] cPickle - stored data differ for same dictionary

2013-02-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is surprising that the pickled representation of 1-element dict varies from run to run. -- components: +Extension Modules -None ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12596

[issue12596] cPickle - stored data differ for same dictionary

2013-02-07 Thread Ramchandra Apte
Ramchandra Apte added the comment: Try `./python -R -c import pickle; print(pickle.dumps({'a':1, 'v':1})) |md5sum`. The output will differ on subsequent run, while trying `./python -R -c import pickle; print(pickle.dumps({'a':1})) |md5sum`, the output is always the same. I suspect because the

[issue17137] Malfunctioning compiled code in Python 3.3 x64

2013-02-07 Thread Jan Lachnitt
Jan Lachnitt added the comment: Knowing that the problem is related to the internal representation of the strings, I have written a short script which reproduces the problem. It is this simple: import os name = 'sub-fcc' wrkdir = 'D:\\Bug reports\\Python\\test' dirname = wrkdir+os.sep+name

[issue12596] cPickle - stored data differ for same dictionary

2013-02-07 Thread Ramchandra Apte
Ramchandra Apte added the comment: Darn, last sentence has some mistakes. I suspect this issue is happening because the order of a dictionary is different on every run (try repr). -- ___ Python tracker rep...@bugs.python.org

[issue12596] cPickle - stored data differ for same dictionary

2013-02-07 Thread Ramchandra Apte
Ramchandra Apte added the comment: Further proof: here are the results of two invocations of `./python -R -c import pickle; print(pickle.dumps({'a':1, 'v':1}))` b'\x80\x03}q\x00(X\x01\x00\x00\x00vq\x01K\x01X\x01\x00\x00\x00aq\x02K\x01u.'

[issue16389] re._compiled_typed's lru_cache causes significant degradation of the mako_v2 bench

2013-02-07 Thread Andrew Svetlov
Changes by Andrew Svetlov andrew.svet...@gmail.com: -- nosy: +asvetlov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16389 ___ ___

[issue17150] pprint could use line continuation for long string literals

2013-02-07 Thread Antoine Pitrou
New submission from Antoine Pitrou: Currently: pprint.pprint({a: xxx * 50}) {'a': 'xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx '} It

[issue6083] Reference counting bug in PyArg_ParseTuple and PyArg_ParseTupleAndKeywords

2013-02-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There are 6 different ways to get a function (see comment around PyCFuncPtr_new() in Modules/_ctypes/_ctypes.c). The other tests just use other ways. I'm more carefully read ctype code and found my mistake. Need to import my_strchr, and not strchr.

[issue16389] re._compiled_typed's lru_cache causes significant degradation of the mako_v2 bench

2013-02-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Maybe lru_cache() should have a key argument so you can specify a specialized key function. It would be interesting to look at the microbenchmarking results. -- ___ Python tracker rep...@bugs.python.org

[issue17137] Malfunctioning compiled code in Python 3.3 x64

2013-02-07 Thread STINNER Victor
STINNER Victor added the comment: It works correctly in Python 3.2.3 64-bit on Windows 8. Can you reproduce the issue on other Windows versions? 2013/2/7 Jan Lachnitt rep...@bugs.python.org: Jan Lachnitt added the comment: Knowing that the problem is related to the internal representation

[issue12596] cPickle - stored data differ for same dictionary

2013-02-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is most probable that the difference is caused by the string interning. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12596 ___

[issue17047] Fix double double words words

2013-02-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Terry, do you want to provide a patch? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17047 ___ ___

[issue17150] pprint could use line continuation for long string literals

2013-02-07 Thread Fred L. Drake, Jr.
Fred L. Drake, Jr. added the comment: I like this. It would be especially nice if it were smart enough to split the segments after sequences of line-ends (r'(\r?\n)+'). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17150

  1   2   >