[issue17023] Subprocess does not find executable on Windows if it is PATH with quotes

2015-02-04 Thread Eli_B
Changes by Eli_B eli.boyar...@gmail.com: -- nosy: +Eli_B ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17023 ___ ___ Python-bugs-list mailing list

Re: basic generator question

2015-02-04 Thread Steven D'Aprano
Neal Becker wrote: I have an object that expects to call a callable to get a value: class obj: def __init__ (self, gen): self.gen = gen def __call__ (self): return self.gen() As written, there is no need for this obj class, it just adds a pointless layer of indirection.

[issue18932] Optimize selectors.EpollSelector.modify()

2015-02-04 Thread STINNER Victor
STINNER Victor added the comment: Here is a patch: Issue #18932, selectors: Optimize the modify() method of selectors Optimize also register() and unregister() methods of KqueueSelector: only call kqueue.control() once. -- keywords: +patch Added file:

Re: meaning of: line, =

2015-02-04 Thread Ethan Furman
On 02/04/2015 07:04 AM, Chris Angelico wrote: On Thu, Feb 5, 2015 at 1:38 AM, Albert-Jan Roskam fo...@yahoo.com wrote: I have also never seen this before, but perhaps this: f = lambda: [42] result, = f() result 42 ... is slightly cleaner than this: result = f()[0] result 42 They're

[issue18932] Optimize selectors.EpollSelector.modify()

2015-02-04 Thread STINNER Victor
STINNER Victor added the comment: I tested SelectSelector, PollSelector, EpollSelector on Linux. I ran tests on FreeBSD, so also tested KqueueSelector. I didn't test DevpollSelector, but the code should be identical to PollSelector (the API is the same). --

pymongo and attribute dictionaries

2015-02-04 Thread Travis Griggs
I really like pymongo. And I really like Python. But one thing my fingers really get tired of typing is someDoc[‘_’id’] This just does not roll of the fingers well. Too many “reach for modifier keys” in a row. I would rather use someDoc._id Googling shows that I’m not the first to want to do

Re: basic generator question

2015-02-04 Thread Ian Kelly
On Wed, Feb 4, 2015 at 6:23 AM, Neal Becker ndbeck...@gmail.com wrote: class rpt: def __init__ (self, value, rpt): self.value = value; self.rpt = rpt def __call__ (self): for i in range (self.rpt): yield self.value Note that this class is just reimplementing

[issue19017] selectors: towards uniform EBADF handling

2015-02-04 Thread STINNER Victor
STINNER Victor added the comment: Guido wrote: This still leaves case (1), where the FD is already bad when we register it. I am actually fine with sometimes raising and sometimes not; I don't want to pay the extra overhead of doing an fstat() or some other syscall just to verify that it is

[issue18932] Optimize selectors.EpollSelector.modify()

2015-02-04 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: _BaseSelectorImpl.modify() still calls unregister() and register(). To my understanding the whole point of this proposal was to avoid that in order to obtain the speedup and (possibly) avoid race conditions. --

Re: pymongo and attribute dictionaries

2015-02-04 Thread Ian Kelly
On Wed, Feb 4, 2015 at 9:50 AM, Travis Griggs travisgri...@gmail.com wrote: I really like pymongo. And I really like Python. But one thing my fingers really get tired of typing is someDoc[‘_’id’] This just does not roll of the fingers well. Too many “reach for modifier keys” in a row. I

Re: meaning of: line, =

2015-02-04 Thread Peter Otten
Rustom Mody wrote: Well its cryptic and confusing (to me at least) And is helped by adding 2 characters: (result,) = f() instead of result, = f() Another alternative is to put a list literal on the lefthand side: def f(): yield 42 ... [result] = f() result 42 (If you're

[issue23389] pkgutil.find_loader raises an ImportError on PEP 420 implicit namespace packages

2015-02-04 Thread Brett Cannon
Changes by Brett Cannon br...@python.org: -- nosy: +brett.cannon ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23389 ___ ___ Python-bugs-list

[issue19017] selectors: towards uniform EBADF handling

2015-02-04 Thread STINNER Victor
STINNER Victor added the comment: To find an invalid FD when select() fails with EBAD, we can use something like: http://ufwi.org/projects/nufw/repository/revisions/b4f66edc5d4dc837f75857f8bffe9015454fdebc/entry/src/nuauth/tls_nufw.c#L408 Oh, the link is dead. Copy/paste of the code: --- /*

[issue23390] make profile-opt: test_distutils failure

2015-02-04 Thread Gregory P. Smith
Changes by Gregory P. Smith g...@krypto.org: -- assignee: - gregory.p.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23390 ___ ___

[issue23383] Clean up bytes formatting

2015-02-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thanks to Martin's suggestions here is even more clean patch. -- Added file: http://bugs.python.org/file38011/bytes_format_2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23383

PSF Python Brochure sold out - help us kick start the second print run !

2015-02-04 Thread M.-A. Lemburg
[Please help spread the word by forwarding to other relevant mailing lists, user groups, etc. world-wide; thanks :-)] *** PSF Python Brochure sold out *** Please help us kick start the second

Re: Cairo module

2015-02-04 Thread Michiel Overtoom
Hi Poul, I recently used cairo in a python project (https://github.com/luismqueral/jumpcityrecords). To see the cairo drawing directly on the screen I wrote a minimal Gtk application. It's in the 'src' directory and is called 'randomdraw.py'. Maybe it is of some help to you. Greetings, --

PSF Python Brochure sold out - help us kick start the second print run !

2015-02-04 Thread M.-A. Lemburg
[Please help spread the word by forwarding to other relevant mailing lists, user groups, etc. world-wide; thanks :-)] *** PSF Python Brochure sold out *** Please help us kick start the second

[issue23393] [Windows] Unable to link with Python in debug configuration

2015-02-04 Thread Steve Dower
Steve Dower added the comment: It's not supported. You'll need to get the Python 2.7 source code and rebuild the binaries under Debug. Python 3.5 will probably have the option to download and install debug versions of the binaries, but Python 2.7 won't be getting this. --

[issue23376] getargs.c: redundant C-contiguity check

2015-02-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See also contiguity tests in Modules/binascii.c and Modules/_ssl.c, -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23376 ___

[issue22963] broken link in PEP 102

2015-02-04 Thread Ezio Melotti
Ezio Melotti added the comment: Ok, so I'm closing this again. Berker, can you add a link to this issue too on the pydotorg tracker? -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22963

[issue17023] Subprocess does not find executable on Windows if it is PATH with quotes

2015-02-04 Thread Tim Golden
Tim Golden added the comment: Under the covers, subprocess is calling CreateProcess so there's really not very much we can do here, short of writing our own PATH-handling. As a matter of fact, passing shell=True will produce the desired effect. Since the only thing this does is to run the

[issue23264] Add pickle support of dict views

2015-02-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thanks Antoine. Do you have objections Raymond? I'm going to provide similar patch for MappingView. More robust tests in updated patch. -- assignee: - serhiy.storchaka Added file: http://bugs.python.org/file38015/pickle_dictviews_2.patch

[issue23393] [Windows] Unable to link with Python in debug configuration

2015-02-04 Thread Sébastien Gallou
New submission from Sébastien Gallou: Hi all, I installed Python (2.7.9) as binaries under Windows. I have trouble trying to compile my application embedding Python, in debug configuration. I have exactly the same problem as described here :

[issue22995] Restrict default pickleability

2015-02-04 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +nadeem.vawda ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22995 ___ ___

[issue18932] Optimize selectors.EpollSelector.modify()

2015-02-04 Thread Charles-François Natali
Charles-François Natali added the comment: Well, I'd like to see at least one benchmark. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18932 ___

[issue23393] [Windows] Unable to link with Python in debug configuration

2015-02-04 Thread Sébastien Gallou
Sébastien Gallou added the comment: Thanks Steve for your quick answer. It's now clear for me. I will then apply this workaround : #ifdef PYTHON_USE_SOURCES #include Python.h #else #if defined WIN32 defined _DEBUG #undef _DEBUG // Undef _DEBUG to use only release version of

[issue20289] Make cgi.FieldStorage a context manager

2015-02-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Ping. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20289 ___ ___ Python-bugs-list mailing list

[issue23393] [Windows] Unable to link with Python in debug configuration

2015-02-04 Thread Steve Dower
Steve Dower added the comment: Afraid not. The closest you can get is building in Release with full debug symbols and no optimisations, which should al lest get you decent debugging. However, you won't get the extra memory check patterns or assertions throughout your code. --

[issue23393] [Windows] Unable to link with Python in debug configuration

2015-02-04 Thread Steve Dower
Steve Dower added the comment: You'll also need to change your project to use the release version of the C Runtime library and undefine _DEBUG throughout, otherwise you'll get conflicts in things like memory allocators and alignment. It's not quite as simple as choosing another lib.

[issue23393] [Windows] Unable to link with Python in debug configuration

2015-02-04 Thread Sébastien Gallou
Sébastien Gallou added the comment: So there is no mean to build my application in debug mode without rebuilding all Python ? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23393 ___

Re: pymongo and attribute dictionaries

2015-02-04 Thread Gregory Ewing
Travis Griggs wrote: for doc in client.db.radios.find({’_id': {’$regex’: ‘^[ABC]'}}): pprint(doc) changes to for doc in ((Doc(d) for d in client.db.radios.find({’_id': {’$regex’: ‘^[ABC]'}})): pprint(doc) Are there other approaches? Feel free to impress me with evil abuses in the interest of

Re: Cairo module

2015-02-04 Thread Poul Riis
Could you be a little more specific (giving, for instance, a full working example)? I tried to interchange surface = cairo.ImageSurface (cairo.FORMAT_ARGB32, WIDTH, HEIGHT) with surface = cairo.Win32Surface (cairo.FORMAT_ARGB32, WIDTH, HEIGHT) but that didn't seem to work. Could matplotlib

Re: pymongo and attribute dictionaries

2015-02-04 Thread Rob Gaddi
On Wed, 04 Feb 2015 13:54:22 -0700, Ian Kelly wrote: I'd prefer map (or itertools.imap in Python 2) over the inline generator in this case: for doc in map(Doc, client.db.radios.find({’_id': {’$regex’: ‘^[ABC]'}})): pprint(doc) Or if you like, a utility function wrapping the same.

[issue23394] No garbage collection at end of main thread

2015-02-04 Thread François Trahan
New submission from François Trahan: When reaching the end of a script, there is no garbage collection done if another thread is running. If you have cyclic references between objects that would be elligible for collection under one of which a __del__ would terminate that thread, execution

[issue23393] [Windows] Unable to link with Python in debug configuration

2015-02-04 Thread Sébastien Gallou
Sébastien Gallou added the comment: Thanks Steve, I will try to build it (hope it will not be too difficult...). If I don't success, I will use your solution. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23393

[issue21998] asyncio: a new self-pipe should be created in the child process after fork

2015-02-04 Thread STINNER Victor
STINNER Victor added the comment: close_self_pipe_after_selector.patch only fixes test2.py, it doesn't fix the general case: run the same event loop in two different event loops. -- ___ Python tracker rep...@bugs.python.org

[issue22087] asyncio: support multiprocessing

2015-02-04 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- title: _UnixDefaultEventLoopPolicy should either create a new loop or explicilty fail when get_event_loop() is called from a multiprocessing child process - asyncio: support multiprocessing ___

Re: pymongo and attribute dictionaries

2015-02-04 Thread Travis Griggs
On Feb 4, 2015, at 9:22 AM, Ian Kelly ian.g.ke...@gmail.com wrote: On Wed, Feb 4, 2015 at 9:50 AM, Travis Griggs travisgri...@gmail.com wrote: I really like pymongo. And I really like Python. But one thing my fingers really get tired of typing is someDoc[‘_’id’] This just does not

[issue18932] Optimize selectors.EpollSelector.modify()

2015-02-04 Thread STINNER Victor
STINNER Victor added the comment: Benchmark on Fedora 21 (Linux 3.18.3, glibc 2.20, Python 3.5 rev 7494f3972726). Original: haypo@selma$ ./python -m timeit -s 'import os, selectors; s=selectors.SelectSelector(); r,w=os.pipe(); s.register(r, selectors.EVENT_READ)' 's.modify(r,

Re: pymongo and attribute dictionaries

2015-02-04 Thread Ian Kelly
On Wed, Feb 4, 2015 at 1:16 PM, Travis Griggs travisgri...@gmail.com wrote: Yes, that is clever. So if you wanted to minimize the amount of typing you had to do at all of your pymongo API call sites, what strategy would you use to keep that relatively terse? Is the following the right

Re: pymongo and attribute dictionaries

2015-02-04 Thread Ian Kelly
On Wed, Feb 4, 2015 at 1:16 PM, Travis Griggs travisgri...@gmail.com wrote: Yes, that is clever. So if you wanted to minimize the amount of typing you had to do at all of your pymongo API call sites, what strategy would you use to keep that relatively terse? Is the following the right

Re: meaning of: line, =

2015-02-04 Thread Chris Angelico
On Thu, Feb 5, 2015 at 4:36 AM, Peter Otten __pete...@web.de wrote: Another alternative is to put a list literal on the lefthand side: def f(): yield 42 ... [result] = f() result 42 Huh, was not aware of that alternate syntax. (If you're worried: neither the list nor the tuple will be

[issue21998] asyncio: a new self-pipe should be created in the child process after fork

2015-02-04 Thread STINNER Victor
STINNER Victor added the comment: Attached at_fork.patch: detect fork and handle fork. * Add _at_fork() method to asyncio.BaseEventLoop * Add _detect_fork() method to asyncio.BaseEventLoop * Add _at_fork() method to selectors.BaseSelector I tried to minimize the number of calls to

Re: pymongo and attribute dictionaries

2015-02-04 Thread Chris Kaynor
On Wed, Feb 4, 2015 at 12:16 PM, Travis Griggs travisgri...@gmail.com wrote: On Feb 4, 2015, at 9:22 AM, Ian Kelly ian.g.ke...@gmail.com wrote: On Wed, Feb 4, 2015 at 9:50 AM, Travis Griggs travisgri...@gmail.com wrote: I really like pymongo. And I really like Python. But one thing my fingers

[issue22087] _UnixDefaultEventLoopPolicy should either create a new loop or explicilty fail when get_event_loop() is called from a multiprocessing child process

2015-02-04 Thread STINNER Victor
STINNER Victor added the comment: This issue looks to be a duplicate of #21998. handle-mp_unix2.patch looks more to a workaround than a real issue. When I write asyncio code, I prefer to pass explicitly the loop, so get_event_loop() should never be called. IMO the methods of the event loop

Re: meaning of: line, =

2015-02-04 Thread Chris Angelico
On Thu, Feb 5, 2015 at 1:08 AM, ast nom...@invalid.com wrote: I dont understand why there is a comma just after line in the following command: line, = plt.plot(x, np.sin(x), '--', linewidth=2) I never saw that before Found here:

Re: meaning of: line, =

2015-02-04 Thread Albert-Jan Roskam
- Original Message - From: Chris Angelico ros...@gmail.com To: Cc: python-list@python.org python-list@python.org Sent: Wednesday, February 4, 2015 3:24 PM Subject: Re: meaning of: line, = On Thu, Feb 5, 2015 at 1:08 AM, ast nom...@invalid.com wrote: I dont understand why

Re: basic generator question

2015-02-04 Thread Peter Otten
Neal Becker wrote: I have an object that expects to call a callable to get a value: class obj: def __init__ (self, gen): self.gen = gen def __call__ (self): return self.gen() As written that looks a bit like if boolean_expression == True: ... as you could replace inst =

[issue20289] Make cgi.FieldStorage a context manager

2015-02-04 Thread Berker Peksag
Berker Peksag added the comment: Here's an updated patch. Thank you Serhiy. -- Added file: http://bugs.python.org/file38017/issue20289_v2.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20289

[issue23345] test_ssl fails on OS X 10.10.2 with latest patch level of OpenSSL libs

2015-02-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset 49f07942fbd7 by Ned Deily in branch '2.7': Issue #23345: Prevent test_ssl failures with large OpenSSL patch level https://hg.python.org/cpython/rev/49f07942fbd7 New changeset 52932cd7f003 by Ned Deily in branch '3.4': Issue #23345: Prevent test_ssl

[issue23345] test_ssl fails on OS X 10.10.2 with latest patch level of OpenSSL libs

2015-02-04 Thread Ned Deily
Ned Deily added the comment: Fixed for 2.7.10, 3.4.3, and 3.5.0. -- resolution: - fixed stage: needs patch - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23345

[issue22087] asyncio: support multiprocessing

2015-02-04 Thread STINNER Victor
STINNER Victor added the comment: See also the https://pypi.python.org/pypi/mpworker project -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22087 ___

Re: Cairo module

2015-02-04 Thread Cousin Stanley
You might consider using python-imaging to display the image after writing it from cairo import image import statement should be import Image note uppercase I -- Stanley C. Kitching Human Being Phoenix, Arizona --

[issue23394] No garbage collection at end of main thread

2015-02-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: Can you post a simple reproducer so that we can more easily see what you are talking about? Thank you. -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23394

Re: ANN: unpyc3 - a python bytecode decompiler for Python3

2015-02-04 Thread Michael Torrie
On 02/04/2015 05:19 PM, sohcahto...@gmail.com wrote: They can take your computer and it doesn't matter if you've got your files on Dropbox. My dog ate my USB stick. :-) I never used a USB stick for school work. At this point, I'm probably sounding like a shill for Dropbox, but I'm

[issue23395] _thread.interrupt_main() errors if SIGINT handler in SIG_DFL, SIG_IGN

2015-02-04 Thread Thomas Kluyver
New submission from Thomas Kluyver: In tracking down an obscure error we were seeing, we boiled it down to this test case for thread.interrupt_main(): import signal, threading, _thread, time signal.signal(signal.SIGINT, signal.SIG_DFL) # or SIG_IGN def thread_run():

[issue23264] Add pickle support of dict views

2015-02-04 Thread Josh Rosenberg
Changes by Josh Rosenberg shadowranger+pyt...@gmail.com: -- nosy: +josh.r ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23264 ___ ___

Re: pymongo and attribute dictionaries

2015-02-04 Thread Steven D'Aprano
Travis Griggs wrote: I really like pymongo. And I really like Python. But one thing my fingers really get tired of typing is someDoc[‘_’id’] I've never used pymongo, so can't comment from experience, but surely any library which encourages, if not requires, that you access private data _id

Re: Cairo module

2015-02-04 Thread Cousin Stanley
Could matplotlib be used to show the image? You might consider using python-imaging to display the image after writing it from cairo import image surface.write_to_png ( x_surface.png ) img = Image.open( x_surface.png ) img.show( command = 'display' ) --

[issue23395] _thread.interrupt_main() errors if SIGINT handler in SIG_DFL, SIG_IGN

2015-02-04 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +haypo, neologix ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23395 ___ ___ Python-bugs-list

Re: ANN: unpyc3 - a python bytecode decompiler for Python3

2015-02-04 Thread sohcahtoa82
On Wednesday, January 28, 2015 at 4:30:11 PM UTC-8, Steven D'Aprano wrote: sohcahto...@gmail.com wrote: I recently finished my CS degree, and I had more than one professor say that they won't take My computer crashed and I lost everything! as an excuse for not being able to turn in

[issue23396] Wrong print for 2.7.9

2015-02-04 Thread John Boersma
New submission from John Boersma: In the tutorial for 2.7.9, in the section on quotes and the escape character, there is the following example text: 'Isn\'t, she said.' 'Isn\'t, she said.' print 'Isn\'t, she said.' Isn't, she said. s = 'First line.\nSecond line.' # \n means newline s #

Re: pymongo and attribute dictionaries

2015-02-04 Thread Steven D'Aprano
Ian Kelly wrote: Extending this to wrap methods of classes is also left as an exercise. (Hint: don't subclass. Search the ActiveState Python recipes for automatic delegation by Alex Martelli.) Do you mean this one? http://code.activestate.com/recipes/52295-automatic-delegation-as-an-

Indentation issues with python

2015-02-04 Thread syed khalid
I downloaded this code and am attempting to run it. I keep getting indentation error. there is a way to handle it with a editor which can recognize the tab or space issue. I have tried different options such as 2 or 3 spaces or tab to no avail. I have encased the error mesage with line 23

Re: pymongo and attribute dictionaries

2015-02-04 Thread Ian Kelly
On Wed, Feb 4, 2015 at 3:38 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Travis Griggs wrote: This just does not roll of the fingers well. Too many “reach for modifier keys” in a row. *One* modifier key in a row is too many? s o m e SHIFT D o c [ ' SHIFT _ i d ' ] I

[issue23396] Wrong print for 2.7.9

2015-02-04 Thread John Boersma
John Boersma added the comment: To clarify - this is in tutorial section 3.1.2. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23396 ___ ___

[issue23351] socket.settimeout(5.0) does not have any effect

2015-02-04 Thread Piotr Jurkiewicz
Piotr Jurkiewicz added the comment: Does not work on Debian 7 Wheezy, kernel 3.2.65. $ python test.py ('sending ', 0) took 0.000s ('sending ', 1) took 0.000s ('sending ', 2) took 0.000s ('sending ', 3) took 0.000s ('sending ', 4) took 0.000s ('sending ', 5) took 0.000s ('sending ', 6) took

[issue23396] Wrong print for 2.7.9

2015-02-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset 2bb5fa752bfc by Benjamin Peterson in branch '2.7': remove parenthesis from print statement (closes #23396) https://hg.python.org/cpython/rev/2bb5fa752bfc -- nosy: +python-dev resolution: - fixed stage: - resolved status: open - closed

[issue23351] socket.settimeout(5.0) does not have any effect

2015-02-04 Thread Charles-François Natali
Charles-François Natali added the comment: It's a kernel bug closing (working fine on my Debian wheezy with a more recent kernel BTW). -- resolution: - third party status: open - closed ___ Python tracker rep...@bugs.python.org

[issue14910] argparse: disable abbreviation

2015-02-04 Thread Berker Peksag
Berker Peksag added the comment: The patch LGTM. In Doc/library/argparse.rst: - add_help=True) + allow_abbrev=True, add_help=True) should be add_help=True, allow_abbrev=True) I'll add a release note and commit it. Thanks! --

[issue23390] make profile-opt: test_distutils failure

2015-02-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset 8957ff9776bd by Gregory P. Smith in branch '3.4': Fixes issue23390: make profile-opt causes -fprofile-generate and related flags https://hg.python.org/cpython/rev/8957ff9776bd New changeset 9c46707e5526 by Gregory P. Smith in branch 'default':

[issue20416] Marshal: special case int and float, don't use references

2015-02-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch which adds separate dict for interned strings (otherwise they can be uninterned) and for bytes. It also slightly simplify the code. -- Added file: http://bugs.python.org/file38012/marshal_refs_by_value_3.patch

basic generator question

2015-02-04 Thread Neal Becker
I have an object that expects to call a callable to get a value: class obj: def __init__ (self, gen): self.gen = gen def __call__ (self): return self.gen() Now I want gen to be a callable that repeats N times. I'm thinking, this sounds perfect for yield class rpt: def __init__

[ANN] PythonQt 3.0 released!

2015-02-04 Thread Florian Link
PythonQt 3.0 has just been released. PythonQt is a dynamic binding of the Qt API and allows to embedd Python easily into C++ Qt applications. The PythonQt bindings offer complete wrappers to most Qt 4 and Qt 5 APIs. PythonQt is open source (LGPL license) and is being used on Windows, Linux

Re: re.findall help

2015-02-04 Thread Jugurtha Hadjar
On 02/04/2015 03:52 AM, w3t...@gmail.com wrote: I am trying to extract the following from a data stream using find all what would be the best way to capture the ip address only from the following text ip=192.168.1.36 port=4992 I also want to make sure the program can handle the ip that is as

[issue14203] PEP-3118: remove obsolete write-locks

2015-02-04 Thread Stefan Krah
Stefan Krah added the comment: I think it's sufficient to test bytesiobuf_getbuffer() on Linux and FreeBSD. The test just checks that the exception is raised. -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python

meaning of: line, =

2015-02-04 Thread ast
hello I dont understand why there is a comma just after line in the following command: line, = plt.plot(x, np.sin(x), '--', linewidth=2) I never saw that before Found here: http://matplotlib.org/examples/lines_bars_and_markers/line_demo_dash_control.html thanks --

Re: meaning of: line, =

2015-02-04 Thread leo kirotawa
You'll find some explanation here: http://stackoverflow.com/questions/1708292/meaning-of-using-commas-and-underscores-with-python-assignment-operator On Wed, Feb 4, 2015 at 12:08 PM, ast nom...@invalid.com wrote: hello I dont understand why there is a comma just after line in the following

Re: meaning of: line, =

2015-02-04 Thread Chris Angelico
On Thu, Feb 5, 2015 at 1:38 AM, Albert-Jan Roskam fo...@yahoo.com wrote: I have also never seen this before, but perhaps this: f = lambda: [42] result, = f() result 42 ... is slightly cleaner than this: result = f()[0] result 42 They're not technically identical. If the thing returned

Re: meaning of: line, =

2015-02-04 Thread Rustom Mody
On Wednesday, February 4, 2015 at 8:14:29 PM UTC+5:30, Albert-Jan Roskam wrote: - Original Message - From: Chris Angelico Sent: Wednesday, February 4, 2015 3:24 PM Subject: Re: meaning of: line, = On Thu, Feb 5, 2015 at 1:08 AM, ast wrote: I dont understand why there is a

[issue14965] super() and property inheritance behavior

2015-02-04 Thread Piotr Dobrogost
Changes by Piotr Dobrogost p...@bugs.python.dobrogost.net: -- nosy: +piotr.dobrogost ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14965 ___ ___

[issue20416] Marshal: special case int and float, don't use references

2015-02-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: And here is alternative patch which uses a hashtable. Both patches have about the same performance for *.pyc files, but marshal_hashtable.patch is much faster for duplicated values. Marshalling [1000]*10**6, [1000.0]*10**6 and [1000.0j]*10**6 with version 3

Re: basic generator question

2015-02-04 Thread Chris Angelico
On Thu, Feb 5, 2015 at 12:23 AM, Neal Becker ndbeck...@gmail.com wrote: Now I want gen to be a callable that repeats N times. I'm thinking, this sounds perfect for yield class rpt: def __init__ (self, value, rpt): self.value = value; self.rpt = rpt def __call__ (self): for i

[issue23390] make profile-opt: test_distutils failure

2015-02-04 Thread Gregory P. Smith
Changes by Gregory P. Smith g...@krypto.org: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23390 ___

[issue23255] SimpleHTTPRequestHandler refactor for more extensible usage.

2015-02-04 Thread Ent
Ent added the comment: No I think it's better if you put up a separate patch. That way any questions other reviewers will have, you will be better suited to answer them. Cheers! -- ___ Python tracker rep...@bugs.python.org

Re: basic generator question

2015-02-04 Thread Joel Goldstick
On Wed, Feb 4, 2015 at 9:32 AM, Chris Angelico ros...@gmail.com wrote: On Thu, Feb 5, 2015 at 12:23 AM, Neal Becker ndbeck...@gmail.com wrote: Now I want gen to be a callable that repeats N times. I'm thinking, this sounds perfect for yield class rpt: def __init__ (self, value,

Re: basic generator question

2015-02-04 Thread Joel Goldstick
On Wed, Feb 4, 2015 at 10:19 AM, Joel Goldstick joel.goldst...@gmail.com wrote: On Wed, Feb 4, 2015 at 9:32 AM, Chris Angelico ros...@gmail.com wrote: On Thu, Feb 5, 2015 at 12:23 AM, Neal Becker ndbeck...@gmail.com wrote: Now I want gen to be a callable that repeats N times. I'm

Re: pymongo and attribute dictionaries

2015-02-04 Thread Steven D'Aprano
Vito De Tullio wrote: Steven D'Aprano wrote: This just does not roll of the fingers well. Too many “reach for modifier keys” in a row. *One* modifier key in a row is too many? s o m e SHIFT D o c [ ' SHIFT _ i d ' ] I'm not OP, but as side note... not everyone has [ as a direct

Re: ANN: unpyc3 - a python bytecode decompiler for Python3

2015-02-04 Thread Dave Angel
On 01/28/2015 07:34 PM, Steven D'Aprano wrote: Devin Jeanpierre wrote: On Wed, Jan 28, 2015 at 1:40 PM, Chris Angelico ros...@gmail.com wrote: On Thu, Jan 29, 2015 at 5:47 AM, Chris Kaynor ckay...@zindagigames.com wrote: I use Google Drive for it for all the stuff I do at home, and use SVN

Usage of some pastebin service proposed

2015-02-04 Thread Abhiram R
Hey guys, I've noticed a lot of people enquiring about syntactic errors and email somewhat butchers the indentation every now and then and the actual error gets buried in this mess. So is it possible to let everyone know that they need to paste their code on some site like pastebin.com and give us

Re: pymongo and attribute dictionaries

2015-02-04 Thread Vito De Tullio
Steven D'Aprano wrote: This just does not roll of the fingers well. Too many “reach for modifier keys” in a row. *One* modifier key in a row is too many? s o m e SHIFT D o c [ ' SHIFT _ i d ' ] I'm not OP, but as side note... not everyone has [ as a direct character on the keyboard. I

Re: Indentation issues with python

2015-02-04 Thread Ben Finney
syed khalid sy...@pacificloud.com writes: I downloaded this code and am attempting to run it. I keep getting indentation error. Indentation is crucial information in Python code. If it is lost, don't waste time trying to guess it; instead, get the correct code. How did you download it? You

Re: Indentation issues with python

2015-02-04 Thread Terry Reedy
class EventHubClient(object): ... def sendMessage(self,body,partition): ... ^ IndentationError: expected an indented block *** and 'def' is not indented as it must be. This must be covered in the tutorial. -- Terry

Re: Usage of some pastebin service proposed

2015-02-04 Thread Ben Finney
Abhiram R abhi.darkn...@gmail.com writes: I've noticed a lot of people enquiring about syntactic errors and email somewhat butchers the indentation every now and then and the actual error gets buried in this mess. It is almost never email that butchers the indentation. It is the mis-use of