Re: Curious function argument

2014-11-15 Thread Steven D'Aprano
ast wrote: Hello I saw in a code from a previous message in this forum a curious function argument. def test(x=[0]): print(x[0]) ## Poor man's object x[0] += 1 test() 0 test() 1 test() 2 I understand that the author wants to implement a global variable x . It would

Re: Call for information - What assumptions can I make about Unix users' access to Windows?

2014-11-15 Thread Paul Moore
On 7 November 2014 15:46, Paul Moore p.f.mo...@gmail.com wrote: To that end, I'd like to get an idea of what sort of access to Windows a typical Unix developer would have. Thanks to all who contributed to this thread. Based on the feedback, I think it's going to be useful to provide two

Re: How about some syntactic sugar for __name__ == '__main__' ?

2014-11-15 Thread Steven D'Aprano
John Ladasky wrote: I have taught Python to several students over the past few years. As I have worked with my students, I find myself bothered by the programming idiom that we use to determine whether a module is being executed or merely imported: if __name__ == '__main__': The use

Re: How about some syntactic sugar for __name__ == '__main__' ?

2014-11-15 Thread Steven D'Aprano
Chris Kaynor wrote: I was thinking along the lines of replacing: if __name__ == __main__: block of code with @main def myFunction() block of code Both blocks of code will be called at the same time. You can't guarantee that, because you cannot tell ahead of time when the if

Re: fileno() not supported in Python 3.1

2014-11-15 Thread Steven D'Aprano
Ian Kelly wrote: On Fri, Nov 14, 2014 at 12:36 AM, Cameron Simpson c...@zip.com.au wrote: On 13Nov2014 15:48, satishmlm...@gmail.com satishmlm...@gmail.com wrote: import sys for stream in (sys.stdin, sys.stdout, sys.stderr): print(stream.fileno()) io.UnsupportedOperation:

Re: How about some syntactic sugar for __name__ == '__main__' ?

2014-11-15 Thread Marko Rauhamaa
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info: if __name__ == '__main__' or condition(): print still executing main() print done loading (I haven't ever done *all* of these things in a *single* file, but I have done all these things at one time or another.) There's no way

Re: A Freudian slip of *EPIC PROPORTIONS*!

2014-11-15 Thread Steven D'Aprano
Terry Reedy wrote: On 11/13/2014 6:11 PM, Rick Johnson wrote: # The parse functions have no idea what to do with # Unicode, so replace all Unicode characters with x. # This is safe so long as the only characters germane # to parsing the structure of Python are 7-bit

Re: Decorators

2014-11-15 Thread Mark Lawrence
On 15/11/2014 07:42, Richard Riehle wrote: Mayank, Thanks. I have only been using Python for about four years, so there are features I have only recently discovered. Decorators are one of them. So far, I encounter other Python users who are also unfamiliar with them. When I discovered

Re: Decorators

2014-11-15 Thread Marko Rauhamaa
Mark Lawrence breamore...@yahoo.co.uk: On 15/11/2014 07:42, Richard Riehle wrote: When I discovered them, I instantly saw how they could be valuable. Would you please be kind enough to get a PhD in interspersing your replies or bottom posting rather than top posting, thank you. I'd take

webhooks

2014-11-15 Thread ngangsia akumbo
What are the basics of implement web hooks with python? I need some detail tutorial in this topic. Thanks -- https://mail.python.org/mailman/listinfo/python-list

Re: Question about installing python and modules on Red Hat Linux 6

2014-11-15 Thread Steven D'Aprano
pythonista wrote: I am developing a python application as a contractor. I would like to know if someone can provide me with some insight into the problems that then infrastructure team has been having. The scope of the project was to install python 2.7.8 and 4 modules/site packages on a

Re: Decorators

2014-11-15 Thread Grant Edwards
On 2014-11-15, Marko Rauhamaa ma...@pacujo.net wrote: Tim Chase python.l...@tim.thechases.com: And decorators are used pretty regularly in just about every code-base that I've touched (I've been programming in Python since early 2004, so I've maintained pre-2.4 code without decorators and

Re: Decorators (was: Re: I love assert)

2014-11-15 Thread Steven D'Aprano
Richard Riehle wrote: Decorators are new in Python, so there are not a lot of people using them. The principle of decorators themselves is as old as Python itself. You could implement them as far back as Python 1.5, if not older: [steve@ando ~]$ python1.5 Python 1.5.2 (#1, Aug 27 2012,

Re: Question about installing python and modules on Red Hat Linux 6

2014-11-15 Thread Grant Edwards
On 2014-11-15, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: pythonista wrote: I am developing a python application as a contractor. I would like to know if someone can provide me with some insight into the problems that then infrastructure team has been having. The scope

Re: Question about installing python and modules on Red Hat Linux 6

2014-11-15 Thread Michael Torrie
On 11/14/2014 08:01 PM, pythonista wrote: Can anyone provide me with insight as to the scope what the problem could have been? Well the fact is that RHEL 6 uses Python 2.6 as a core system package. Many system utilities depend on it, so it cannot be replaced with a newer version. You must

Re: Question about installing python and modules on Red Hat Linux 6

2014-11-15 Thread Michael Torrie
On 11/15/2014 08:15 AM, Steven D'Aprano wrote: A fresh linux build of Red Hat Linux 6? RHL 6 was discontinued in 2000. Yes I know you're making a point about not assuming anything, but the odds are very good that the OP meant RHEL6. And meaning RHEL6, there are some good reasons why the

Strange result with timeit execution time measurment

2014-11-15 Thread ast
Hi I needed a function f(x) which looks like sinus(2pi.x) but faster. I wrote this one: -- from math import floor def sinusLite(x): x = x - floor(x) return -16*(x-0.25)**2 + 1 if x 0.5 else 16*(x-0.75)**2 - 1 -- then i used module timeit

Re: Question about installing python and modules on Red Hat Linux 6

2014-11-15 Thread Michael Torrie
On 11/14/2014 08:01 PM, pythonista wrote: The scope of the project was to install python 2.7.8 and 4 modules/site packages on a fresh linux build. I neglected to put the URL for software collections in my reply to you. Here it is. https://www.softwarecollections.org/en/scls/rhscl/python27/

Re: Question about installing python and modules on Red Hat Linux 6

2014-11-15 Thread Michael Torrie
On 11/15/2014 10:13 AM, Michael Torrie wrote: If it's a package that won't conflict, such as Python 2.4, you can Ahem, that should have been 3.4 -- https://mail.python.org/mailman/listinfo/python-list

Re: Strange result with timeit execution time measurment

2014-11-15 Thread Peter Otten
ast wrote: Hi I needed a function f(x) which looks like sinus(2pi.x) but faster. I wrote this one: -- from math import floor def sinusLite(x): x = x - floor(x) return -16*(x-0.25)**2 + 1 if x 0.5 else 16*(x-0.75)**2 - 1 --

Re:Strange result with timeit execution time measurment

2014-11-15 Thread Dave Angel
ast nom...@invalid.com Wrote in message: Hi I needed a function f(x) which looks like sinus(2pi.x) but faster. I wrote this one: -- from math import floor def sinusLite(x): x = x - floor(x) return -16*(x-0.25)**2 + 1 if x 0.5 else 16*(x-0.75)**2 - 1

Re: Strange result with timeit execution time measurment

2014-11-15 Thread Peter Pearson
On Sat, 15 Nov 2014 18:07:30 +0100, ast wrote: I needed a function f(x) which looks like sinus(2pi.x) but faster. I wrote this one: -- from math import floor def sinusLite(x): x = x - floor(x) return -16*(x-0.25)**2 + 1 if x 0.5 else 16*(x-0.75)**2 - 1

Re: Strange result with timeit execution time measurment

2014-11-15 Thread Ian Kelly
On Sat, Nov 15, 2014 at 10:07 AM, ast nom...@invalid.com wrote: Hi I needed a function f(x) which looks like sinus(2pi.x) but faster. I wrote this one: -- from math import floor def sinusLite(x): x = x - floor(x) return -16*(x-0.25)**2 + 1 if x 0.5 else

Re: A Freudian slip of *EPIC PROPORTIONS*!

2014-11-15 Thread Terry Reedy
On 11/15/2014 7:28 AM, Steven D'Aprano wrote: Terry Reedy wrote: On 11/13/2014 6:11 PM, Rick Johnson wrote: # The parse functions have no idea what to do with # Unicode, so replace all Unicode characters with x. # This is safe so long as the only characters germane #

Re: Decorators

2014-11-15 Thread Terry Reedy
On 11/15/2014 8:24 AM, Marko Rauhamaa wrote: I'd take top-posting if I were enlightened about how decorators could be valuable. Here is part of the original rationale. @deco(arg) def f: suite is (for this discussion) equivalent to def f: suite f = deco(arg)(f) The latter requires writing

caught in the import web again

2014-11-15 Thread Charles T. Smith
Now, I'm getting these errors: ImportError: cannot import name ... and AttributeError: 'module' object has no attribute ... (what is 'module'?) Is there a way to resolve this without having to restructure my code every couple of days? I thought using imports of the form: from module

Re: caught in the import web again

2014-11-15 Thread Ben Finney
Charles T. Smith cts.private.ya...@gmail.com writes: Now, I'm getting these errors: Please reduce the problem to a minimal, complete example demonstrating the behaviour URL:http://sscce.org/ so that you can show us exactly what's happening. AttributeError: 'module' object has no attribute

Re: Question about installing python and modules on Red Hat Linux 6

2014-11-15 Thread Steven D'Aprano
Grant Edwards wrote: On 2014-11-15, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: pythonista wrote: I am developing a python application as a contractor. I would like to know if someone can provide me with some insight into the problems that then infrastructure team has

Re: caught in the import web again

2014-11-15 Thread Denis McMahon
On Sat, 15 Nov 2014 22:52:33 +, Charles T. Smith wrote: Now, I'm getting these errors: ImportError: cannot import name ... and AttributeError: 'module' object has no attribute ... It would be useful to know what you're actually trying to import and what the complete error

Re: Question about installing python and modules on Red Hat Linux 6

2014-11-15 Thread Chris Angelico
On Sun, Nov 16, 2014 at 12:08 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Assuming it was RHEL 6, then installing Python 2.7 from source as a separate application from the system Python should be trivially easy, half an hour's work. Download the source, untar, run

Re: Question about installing python and modules on Red Hat Linux 6

2014-11-15 Thread Michael Torrie
On 11/15/2014 06:08 PM, Steven D'Aprano wrote: Assuming it was RHEL 6, then installing Python 2.7 from source as a separate application from the system Python should be trivially easy, half an hour's work. Download the source, untar, run ./configure, make, make altinstall and you should be

Re: Question about installing python and modules on Red Hat Linux 6

2014-11-15 Thread Chris Angelico
On Sun, Nov 16, 2014 at 12:57 PM, Michael Torrie torr...@gmail.com wrote: In my last system administration job, we forbade installing from source, at least in the manner you are describing. It's a maintenance nightmare. Especially when it comes time to upgrade the system and get things up

Where is inspect() located?

2014-11-15 Thread Igor Korot
Hi, ALL, C:\Documents and Settings\Igor.FORDANWORK\Desktop\winpdbpython Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Intel)] on win32 Type help, copyright, credits or license for more information. from a.b import c print c.classA class 'a.b.c.classA'

Re: Where is inspect() located?

2014-11-15 Thread Chris Angelico
On Sun, Nov 16, 2014 at 3:12 PM, Igor Korot ikoro...@gmail.com wrote: In the https://docs.python.org/2/library/inspect.html, it says it is located in Lib/inspect.py. What am I missing? Or its only for 3.x? You need to import it. If you're curious, you can find out exactly where it's imported

Re:Where is inspect() located?

2014-11-15 Thread Dave Angel
Igor Korot ikoro...@gmail.com Wrote in message: Hi, ALL, C:\Documents and Settings\Igor.FORDANWORK\Desktop\winpdbpython Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Intel)] on win32 Type help, copyright, credits or license for more information. from a.b import c print

PyWart: Python's import statement and the history of external dependencies

2014-11-15 Thread Rick Johnson
Python's attempt to solve the external dependencies problem has yet to produce the results that many people, including myself, would like. Actually, Python is not alone in this deficiency, no, Python is just *ANOTHER* language in a *STRING* of languages over the years who has *YET AGAIN*

Re: PyWart: Python's import statement and the history of external dependencies

2014-11-15 Thread Chris Angelico
On Sun, Nov 16, 2014 at 4:01 PM, Rick Johnson rantingrickjohn...@gmail.com wrote: Creating an implicit name resolution system (aka: import) to abstract away an explicit name resolution system (file-paths) has resulted in more problems that it can solve: 1. Name clashes! 2. Smaller

Re: Efficient Threading

2014-11-15 Thread Dan Stromberg
On Fri, Nov 14, 2014 at 10:42 AM, Empty Account empty...@gmail.com wrote: Hi, I am thinking about writing a load test tool in Python, so I am interested in how I can create the most concurrent threads/processes with the fewest OS resources. I would imagine that I/O would need to be

Re: fileno() not supported in Python 3.1

2014-11-15 Thread Dan Stromberg
On Thu, Nov 13, 2014 at 3:48 PM, satishmlm...@gmail.com wrote: import sys for stream in (sys.stdin, sys.stdout, sys.stderr): print(stream.fileno()) io.UnsupportedOperation: fileno Is there a workaround? -- https://mail.python.org/mailman/listinfo/python-list Works for me,

Re: fileno() not supported in Python 3.1

2014-11-15 Thread Chris Angelico
On Sun, Nov 16, 2014 at 4:25 PM, Dan Stromberg drsali...@gmail.com wrote: Works for me, although it's a little different in Jython: $ pythons --command 'import sys; print(sys.stdin.fileno())' /usr/local/jython-2.7b3/bin/jython good org.python.core.io.StreamIO@170ed6ab Huh, that is curious.

frame.f_locals['__class__'] -- When does it (not) exist and why?

2014-11-15 Thread kevinarpe
Hello, I am CPython 3.4+ user on Linux. I am writing a little library for myself to improve the traceback module -- print_exc() and friends. I want to include the module name, class name (if possible), and function name. Some background: traceback.print_exc() iterates through traceback

Re: frame.f_locals['__class__'] -- When does it (not) exist and why?

2014-11-15 Thread Chris Angelico
On Sun, Nov 16, 2014 at 4:25 PM, kevina...@gmail.com wrote: When super().__init__() is called, a 'magic' local appears in frame.f_locals called '__class__'. Helpfully, it has the correct class for the context, which will differ from type(self). (I discovered this magic local by poking

Re: frame.f_locals['__class__'] -- When does it (not) exist and why?

2014-11-15 Thread kevinarpe
Apologies for previous code example. Yes, the 'def class' should read: 'class'. Writing a sample to better demonstrate the issue made me realize that super() is doing something special. It is injecting the magic '__class__' local. I should rephrase my question: How do I get the declaring

Re: caught in the import web again

2014-11-15 Thread dieter
Charles T. Smith cts.private.ya...@gmail.com writes: Now, I'm getting these errors: ImportError: cannot import name ... and AttributeError: 'module' object has no attribute ... (what is 'module'?) Is there a way to resolve this without having to restructure my code every couple of

encode and decode builtins

2014-11-15 Thread Garrett Berg
I made the switch to python 3 about two months ago, and I have to say I love everything about it, *especially* the change to using only bytes and str (no more unicode! or... everything is unicode!) As someone who works with embedded devices, it is great to know what data I am working with.

Re: encode and decode builtins

2014-11-15 Thread Ben Finney
Garrett Berg googb...@gmail.com writes: I made the switch to python 3 about two months ago, and I have to say I love everything about it, *especially* the change to using only bytes and str (no more unicode! or... everything is unicode!) As someone who works with embedded devices, it is great

[issue22878] PEP 477 (ensurepip backport to 2.7.9): make install and make altinstall integration

2014-11-15 Thread Ned Deily
Changes by Ned Deily n...@acm.org: -- assignee: ned.deily components: Build nosy: ned.deily priority: normal severity: normal status: open title: PEP 477 (ensurepip backport to 2.7.9): make install and make altinstall integration versions: Python 2.7

[issue22193] Add _PySys_GetSizeOf()

2014-11-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset 3537994fa43b by Serhiy Storchaka in branch '2.7': Issue #22193: Fixed integer overflow error in sys.getsizeof(). https://hg.python.org/cpython/rev/3537994fa43b New changeset df5c6b05238e by Serhiy Storchaka in branch '3.4': Issue #22193: Fixed

[issue22823] Use set literals instead of creating a set from a list

2014-11-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset f4e75efdc7f1 by Serhiy Storchaka in branch 'default': Issue #22823: Use set literals instead of creating a set from a tuple. https://hg.python.org/cpython/rev/f4e75efdc7f1 -- ___ Python tracker

[issue22823] Use set literals instead of creating a set from a list

2014-11-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Can you also make a separate mock patch and assign it to Michael Foord for review? Here is a patch. It also replaces constructing sets from generators with set comprehensions. -- assignee: serhiy.storchaka - michael.foord nosy: +michael.foord

[issue22193] Add _PySys_GetSizeOf()

2014-11-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Also fixed an error in _PySys_GetSizeOf declaration (thanks yomgui1). Thanks all for reviews and found bugs. -- stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org

[issue18348] Additional code pages for EBCDIC

2014-11-15 Thread roskakori
roskakori added the comment: I just released a package on PyPI that adds various EBCDIC codecs for Python 2.6+ and Python 3.1+, see https://pypi.python.org/pypi/ebcdic. I agree with Marc-Andre, maintaining this is easier as separate package. -- ___

[issue18348] Additional code pages for EBCDIC

2014-11-15 Thread STINNER Victor
STINNER Victor added the comment: There are more and more codecs on PyPI. I would be nice to have a list somewhere. @roskakori: Could you please create a page at https://wiki.python.org/ ? Example: https://wiki.python.org/moin/Codecs -- ___ Python

[issue22870] urlopen timeout failed with SSL socket

2014-11-15 Thread Dave Tian
Dave Tian added the comment: Hi David, Thanks for your quick response. I have tried Python 3.4.2 using urllib.request.urlopen() - still not working. Below is the backtrace. I am not sure if this is a bug of PySSL_SSLread, which returns nothing yet without timeout. If you want me to dig into

[issue18813] Speed up slice object processing

2014-11-15 Thread Stefan Behnel
Changes by Stefan Behnel sco...@users.sourceforge.net: Removed file: http://bugs.python.org/file31421/faster_PyEval_SliceIndex.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18813 ___

[issue22869] Split pylifecycle.c out from pythonrun.c

2014-11-15 Thread Antoine Pitrou
Antoine Pitrou added the comment: +1 on the principle. reference count printing is duplicated (lifecycle prints it at shutdown, pythonrun at the interactive prompt) You could make it an API in object.c. * pythonrun references PyInspect_Flag directly without an extern declaration *

[issue22870] urlopen timeout failed with SSL socket

2014-11-15 Thread R. David Murray
R. David Murray added the comment: I won't be the one, as I'm not conversant with the ssl C code. What would be helpful right now would be a recipe for reproducing the problem. -- nosy: +alex, pitrou ___ Python tracker rep...@bugs.python.org

[issue22824] Update reprlib to use set literals

2014-11-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset cf5b910ac4c8 by Raymond Hettinger in branch 'default': Issue #22824: Simplify reprlib output format for empty arrays https://hg.python.org/cpython/rev/cf5b910ac4c8 -- ___ Python tracker

[issue22876] ip_interface can't be broadcast or number net

2014-11-15 Thread R. David Murray
R. David Murray added the comment: Well, it can be the network, even though it isn't typically (and some devices don't support it...I'm pretty sure I remember doing it on a Cisco, though I wouldn't swear to it without testing :). Same is true for broadcast, though that would be *really*

[issue18813] Speed up slice object processing

2014-11-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Are there any benchmarks? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18813 ___ ___ Python-bugs-list

[issue22864] Add filter to multiprocessing.Pool

2014-11-15 Thread Travis Thieman
Travis Thieman added the comment: Why is it insufficient to run a synchronous 'filter' over the list returned by 'Pool.map'? These functional constructs are inherently composable, and we should favor composing simple implementations of each rather than implementing special cases of them

[issue21614] Case sensitivity problem in multiprocessing.

2014-11-15 Thread Ben Yelsey
Ben Yelsey added the comment: Hi, could you please list more exact steps to reproduce, e.g. directory/file layout and import statements? -- nosy: +inlinestyle ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21614

[issue22825] Modernize TextFile

2014-11-15 Thread Éric Araujo
Éric Araujo added the comment: I would not touch any internal parts of distutils, such as TextFile. It is not a public class meant for general usage. The code is not ideal but not broken. -- ___ Python tracker rep...@bugs.python.org

[issue18813] Speed up slice object processing

2014-11-15 Thread Stefan Behnel
Stefan Behnel added the comment: As mentioned, the fannkuch benchmark benefits quite a bit from the fast path, by 8%. It was a while ago when I tested, though, so I don't have exact numbers ATM. -- ___ Python tracker rep...@bugs.python.org

[issue22876] ip_interface can't be broadcast or number net

2014-11-15 Thread Вячеслав
Вячеслав added the comment: These addresses are used by each interface in the network and they can not be the address of the interface, of course have the technology ip-unnumbered. But it's more a special case. but I was confused behavior: set(ip_network(u'192.168.1.0/29'))

[issue22536] subprocess should include filename in FileNotFoundError exception

2014-11-15 Thread Travis Thieman
Travis Thieman added the comment: The attached patch includes the first element in args in _execute_child to the OSError exception subclass. This correctly populates the 'filename' field on the resulting exception. A test is also included that fails without the patch. -- keywords:

[issue22876] ip_interface can't be broadcast or number net

2014-11-15 Thread Вячеслав
Вячеслав added the comment: Probably worth noting that network is unnumbered in ip_network and ip_interface functions. Based on this flag to decide whether there is a possibility to use the network address and broadcast address in the network What do you think about this? --

[issue22823] Use set literals instead of creating a set from a list

2014-11-15 Thread Terry J. Reedy
Terry J. Reedy added the comment: mock patch LGTM -- stage: patch review - commit review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22823 ___

[issue22823] Use set literals instead of creating a set from a list

2014-11-15 Thread Raymond Hettinger
Raymond Hettinger added the comment: IMO, the _non_defaults set comprehension in mock.py ought to be replaced with a set of internable string constants. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22823

[issue17293] uuid.getnode() MAC address on AIX

2014-11-15 Thread koobs
koobs added the comment: I only attached the 2.7 build log because the failures from 3.4 and 3.x are identical, copying them here for completeness: From 3.4: == ERROR: test_arp_getnode (test.test_uuid.TestUUID)

[issue22879] Make set's add and discard methods return useful information

2014-11-15 Thread Brecht Machiels
New submission from Brecht Machiels: set's add() method would be a little bit more useful if it would return True if the added value was already present in the set, and False if it wasn't (or the other way around). Similarly, discard() could report whether the discarded value was present in

[issue22879] Make set's add and discard methods return useful information

2014-11-15 Thread R. David Murray
R. David Murray added the comment: Hmm. The fact that it could be either way around makes it less attractive. That is, if it isn't intuitively obvious what the truth value would mean, it is probably a bad idea to have this behavior. -- nosy: +r.david.murray, rhettinger

[issue22878] PEP 477 (ensurepip backport to 2.7.9): make install and make altinstall integration

2014-11-15 Thread Ned Deily
New submission from Ned Deily: As part of PEP 477, the attached patch backports to Python 2.7.9 the configure and Makefile integration for ensurepip from Python 3 (PEP 453 / Issue19553). As described in PEP 477, for Python 2 ensurepip is not enabled by default by configure. If there are no

[issue22879] Make set's add and discard methods return useful information

2014-11-15 Thread Raymond Hettinger
Raymond Hettinger added the comment: This has come up once before and it was rejected for several reasons including the one David mentioned. In Python, code reads more clearly with the usual: for elem in iterable: if elem not in seen: seen.add(elem)

[issue22823] Use set literals instead of creating a set from a list

2014-11-15 Thread Terry J. Reedy
Terry J. Reedy added the comment: OK, someone can copy and paste this. non_defaults = { '__get__', '__set__', '__delete__', '__reversed__', '__missing__', '__reduce__', '__reduce_ex'__, '__getinitargs__', '__getnewargs__', '__getstate__', '__setstate__', '__getformat__',

[issue22880] hmac.new docs show optional args incorrectly

2014-11-15 Thread Roy Smith
New submission from Roy Smith: At https://docs.python.org/2/library/hmac.html, hmac.new() is shown as hmac.new(key[, msg[, digestmod]]) This implies that digestmod can only be given if msg is given. This is incorrect. Either can be given without the other. -- assignee: docs@python

[issue22536] subprocess should include filename in FileNotFoundError exception

2014-11-15 Thread Berker Peksag
Changes by Berker Peksag berker.pek...@gmail.com: -- nosy: +berker.peksag stage: - patch review versions: +Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22536 ___

[issue22869] Split pylifecycle.c out from pythonrun.c

2014-11-15 Thread Nick Coghlan
Nick Coghlan added the comment: It turns out *all* the global config variations are in pydebug.h (and they're basically the only thing in there, aside from the environment variable access macro). That seems a little weird to me (perhaps historical due to the early global config variables

[issue22869] Split pylifecycle.c out from pythonrun.c

2014-11-15 Thread Nick Coghlan
Nick Coghlan added the comment: I think this is ready to go now, unless anyone spots any major flaws I missed. -- stage: patch review - commit review Added file: http://bugs.python.org/file37204/split_pythonrun_v3.diff ___ Python tracker

[issue22869] Split pylifecycle.c out from pythonrun.c

2014-11-15 Thread Nick Coghlan
Nick Coghlan added the comment: Oops, global config variations above should have been global config variable declarations. I guess my brain decided that was too much typing and jammed the last two words together :) -- ___ Python tracker