[issue29220] Python 3.6 regression/change using logging.addLevelName() to clear a name

2017-01-09 Thread Mark Blakeney
Mark Blakeney added the comment: Well my work-around is not ideal as I get an extra embedded space in those messages. I'm surprised this is "not a common use case"? It doesn't really worry me but it is a 3.6 incompatibility change which I would think is always far better to avoid. --

[issue29222] Python3 interactive shell hangs on

2017-01-09 Thread Eryk Sun
Eryk Sun added the comment: As a workaround, the platform's default Ctrl+C handler should allow killing the process: >>> signal.signal(signal.SIGINT, signal.SIG_DFL) >>> counter = itertools.count() >>> 'count' in counter ^C But it's nowhere near as useful as a

[issue29220] Python 3.6 regression/change using logging.addLevelName() to clear a name

2017-01-09 Thread Vinay Sajip
Vinay Sajip added the comment: This change was due to fixing #27937. Since yours is not a common use case, and since the workaround works for you, I propose not to change things back. -- assignee: -> vinay.sajip status: open -> pending ___ Python

Re: Temporary variables in list comprehensions

2017-01-09 Thread Serhiy Storchaka
On 09.01.17 12:46, Paul Rubin wrote: Serhiy Storchaka writes: gen = (expensive_calculation(x) for x in data) result = [(tmp, tmp + 1) for tmp in gen] result = [(tmp, tmp+1) for tmp in map(expensive_calculation, data)] Yes, of course, but only in the case of

[issue29215] pyport.h uses non C90-style comment

2017-01-09 Thread Benjamin Peterson
Benjamin Peterson added the comment: C99 is required to build or include Python headers since 3.6. PEP 7 could be clearer. The bullet about C99 is meant to override for 3.6 other directives such as the comment prohibition. -- resolution: -> not a bug status: open -> closed

RE: Using namedtuples field names for column indices in a list of lists

2017-01-09 Thread Deborah Swanson
Ethan Furman wrote, on January 09, 2017 10:06 PM > > On 01/09/2017 08:51 PM, Deborah Swanson wrote: > > Ethan Furman wrote, on January 09, 2017 8:01 PM > > >> As I said earlier, I admire your persistence -- but take some time > >> and learn the basic vocabulary as that will make it much easier

[issue29222] Python3 interactive shell hangs on

2017-01-09 Thread R. David Murray
R. David Murray added the comment: This is an instance of the the problem discussed in Issue 26351. -- nosy: +r.david.murray resolution: -> duplicate stage: -> resolved superseder: -> Occasionally check for Ctrl-C in long-running operations like sum

[issue29222] Python3 interactive shell hangs on

2017-01-09 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +rhettinger ___ Python tracker ___ ___

[issue29222] Python3 interactive shell hangs on

2017-01-09 Thread Vex Woo
New submission from Vex Woo: I'v tested the following steps against python3.5 and python3.6. Python shell hangs on. $ python3.6 Python 3.6.0 (v3.6.0:41df79263a11, Dec 22 2016, 17:23:13) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for

Re: Is enum iteration order guaranteed?

2017-01-09 Thread Steven D'Aprano
On Tuesday 10 January 2017 16:55, Ethan Furman wrote: > On 01/09/2017 09:18 PM, Steven D'Aprano wrote: > >> The docs say that enums can be iterated over, but it isn't clear to me >> whether they are iterated over in definition order or value order. >> >> If I have: >> >> class MarxBros(Enum): >>

[issue26632] @public - an __all__ decorator

2017-01-09 Thread Nick Coghlan
Nick Coghlan added the comment: Chiming in so Barry & Zach can take this feedback into account for any future proposal: - I think the specific term "public" has too much baggage from other languages, especially in the sense that it implies that "private" is the default. In reality, all

[issue29219] TracebackException(capture_locals=True) may fail with RecursionError

2017-01-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could you please provide a script that reproduces an issue? Seems the repr of uninitialized CDLL instance is used. It causes an infinite recursion in attempt to resolve not set private attributes (_name, _handle, _FuncPtr). -- components: +ctypes

Re: Using namedtuples field names for column indices in a list of lists

2017-01-09 Thread Ethan Furman
On 01/09/2017 08:51 PM, Deborah Swanson wrote: Ethan Furman wrote, on January 09, 2017 8:01 PM As I said earlier, I admire your persistence -- but take some time and learn the basic vocabulary as that will make it much easier for you to ask questions, and for us to give you meaningful

Re: Is enum iteration order guaranteed?

2017-01-09 Thread Ethan Furman
On 01/09/2017 09:18 PM, Steven D'Aprano wrote: The docs say that enums can be iterated over, but it isn't clear to me whether they are iterated over in definition order or value order. If I have: class MarxBros(Enum): GROUCHO = 999 CHICO = 5 HARPO = 11 ZEPPO = auto()

[issue29221] ABC Recursion Error on isinstance() with less than recursion limit class hierarchy depth

2017-01-09 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +serhiy.storchaka versions: -Python 3.3, Python 3.4 ___ Python tracker ___

Re: Enum with only a single member

2017-01-09 Thread Jussi Piitulainen
Steven D'Aprano writes: > Is it silly to create an enumeration with only a single member? That > is, a singleton enum? > > from enum import Enum > > class Unique(Enum): > FOO = auto() > > > The reason I ask is that I have two functions that take an enum > argument. The first takes one of

Is enum iteration order guaranteed?

2017-01-09 Thread Steven D'Aprano
The docs say that enums can be iterated over, but it isn't clear to me whether they are iterated over in definition order or value order. If I have: class MarxBros(Enum): GROUCHO = 999 CHICO = 5 HARPO = 11 ZEPPO = auto() GUMMO = -1 GROUCHO, CHICO, HARPO, ZEPPO, GUMMO =

RE: Using namedtuples field names for column indices in a list of lists

2017-01-09 Thread Deborah Swanson
Erik wrote, on January 09, 2017 8:06 PM > > On 10/01/17 03:02, Deborah Swanson wrote: > > Erik wrote, on January 09, 2017 5:47 PM > >> IIRC, you create it using a list comprehension which creates the > >> records. A list comprehension always creates a list. > > > > Well no. The list is created

Re: Enum with only a single member

2017-01-09 Thread Ethan Furman
On 01/09/2017 08:43 PM, Steven D'Aprano wrote: Is it silly to create an enumeration with only a single member? That is, a singleton enum? from enum import Enum class Unique(Enum): FOO = auto() The reason I ask is that I have two functions that take an enum argument. The first takes one

RE: Using namedtuples field names for column indices in a list of lists

2017-01-09 Thread Deborah Swanson
Ethan Furman wrote, on January 09, 2017 8:01 PM > > On 01/09/2017 07:02 PM, Deborah Swanson wrote: > > Erik wrote, on January 09, 2017 5:47 PM > > >> As people keep saying, the object you have called 'records' is a > >> *list* of namedtuple objects. It is not a namedtuple. > >> > >> IIRC, you

Enum with only a single member

2017-01-09 Thread Steven D'Aprano
Is it silly to create an enumeration with only a single member? That is, a singleton enum? from enum import Enum class Unique(Enum): FOO = auto() The reason I ask is that I have two functions that take an enum argument. The first takes one of three enums: class MarxBros(Enum):

RE: Using namedtuples field names for column indices in a list of lists

2017-01-09 Thread Deborah Swanson
MRAB wrote, on January 09, 2017 7:37 PM > > On 2017-01-10 03:02, Deborah Swanson wrote: > > Erik wrote, on January 09, 2017 5:47 PM > >> As people keep saying, the object you have called 'records' is a > >> *list* of namedtuple objects. It is not a namedtuple. > >> > >> IIRC, you create it using

[issue29221] ABC Recursion Error on isinstance() with less than recursion limit class hierarchy depth

2017-01-09 Thread Anthony Scopatz
New submission from Anthony Scopatz: Classes that have an abstract base class somewhere in their hierarchy have a significantly reduced depth with respect to the recursion limit. In the attached minimal example, the class hierarchy is only able to be 245 deep past the ABC before a recursion

Re: Using namedtuples field names for column indices in a list of lists

2017-01-09 Thread Erik
On 10/01/17 03:02, Deborah Swanson wrote: Erik wrote, on January 09, 2017 5:47 PM IIRC, you create it using a list comprehension which creates the records. A list comprehension always creates a list. Well no. The list is created with: records.extend(Record._make(row) for row in rows) No,

Re: Using namedtuples field names for column indices in a list of lists

2017-01-09 Thread Ethan Furman
On 01/09/2017 07:02 PM, Deborah Swanson wrote: Erik wrote, on January 09, 2017 5:47 PM As people keep saying, the object you have called 'records' is a *list* of namedtuple objects. It is not a namedtuple. IIRC, you create it using a list comprehension which creates the records. A list

[issue29220] Python 3.6 regression/change using logging.addLevelName() to clear a name

2017-01-09 Thread Xiang Zhang
Changes by Xiang Zhang : -- nosy: +vinay.sajip ___ Python tracker ___ ___ Python-bugs-list

Re: Using namedtuples field names for column indices in a list of lists

2017-01-09 Thread MRAB
On 2017-01-10 03:02, Deborah Swanson wrote: Erik wrote, on January 09, 2017 5:47 PM As people keep saying, the object you have called 'records' is a *list* of namedtuple objects. It is not a namedtuple. IIRC, you create it using a list comprehension which creates the records. A list

[issue29217] Documentation for uuid has wrong description for variant

2017-01-09 Thread Xiang Zhang
Xiang Zhang added the comment: Thanks for your report David. :-) I simply remove the type description since I think the type of the constants doesn't matter here. -- nosy: +xiang.zhang resolution: -> fixed stage: -> resolved status: open -> closed versions: -Python 3.3, Python 3.4

[issue29217] Documentation for uuid has wrong description for variant

2017-01-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 0d4e0a736688 by Xiang Zhang in branch '2.7': Issue #29217: Fix the wrong type description of UUID.variant. https://hg.python.org/cpython/rev/0d4e0a736688 New changeset 1f8e8e16e996 by Xiang Zhang in branch '3.5': Issue #29217: Fix the wrong type

[issue24699] TemporaryDirectory is cleaned up twice

2017-01-09 Thread Eryk Sun
Changes by Eryk Sun : -- resolution: -> out of date stage: -> resolved ___ Python tracker ___

Re: Clickable hyperlinks

2017-01-09 Thread Tim Chase
On 2017-01-09 14:33, Deborah Swanson wrote: > Ok, here is the crux of this thread's communication problem. I > didn't ask, or particularly care for all these lectures on the > technology of terminal emulators. I asked how to code Python to > make clickable links. The crux of the problem is that

[issue29145] failing overflow checks in replace_*

2017-01-09 Thread Xiang Zhang
Xiang Zhang added the comment: Thanks you all. :-) -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker

[issue29145] failing overflow checks in replace_*

2017-01-09 Thread Roundup Robot
Roundup Robot added the comment: New changeset 09b1cdac74de by Xiang Zhang in branch '3.5': Issue #29145: Fix overflow checks in str.replace() and str.join(). https://hg.python.org/cpython/rev/09b1cdac74de New changeset d966ccda9f17 by Xiang Zhang in branch '3.6': Issue #29145: Merge 3.5.

RE: Using namedtuples field names for column indices in a list of lists

2017-01-09 Thread Deborah Swanson
Erik wrote, on January 09, 2017 5:47 PM > As people keep saying, the object you have called 'records' > is a *list* > of namedtuple objects. It is not a namedtuple. > > IIRC, you create it using a list comprehension which creates the > records. A list comprehension always creates a list. Well

Re: Temporary variables in list comprehensions

2017-01-09 Thread Paul Rubin
Ben Bacarisse writes: > [(lambda tmp: (tmp, tmp+1))(expensive_calculation(x)) for x in data] Nice. The Haskell "let" expression is implemented as syntax sugar for that, I believe. -- https://mail.python.org/mailman/listinfo/python-list

[issue29220] Python 3.6 regression/change using logging.addLevelName() to clear a name

2017-01-09 Thread Mark Blakeney
New submission from Mark Blakeney: I have code which does a logging.addLevelName(logging.INFO, '') so that the logging level name is not displayed in INFO messages, but is in all other levels. I have been running this code fine since many versions of Python 2 through to 3.5. Now running with

Re: Temporary variables in list comprehensions

2017-01-09 Thread Tim Chase
On 2017-01-09 13:16, Paul Rubin wrote: > Tim Chase writes: > >> result = [(tmp, tmp+1) for tmp in map(expensive_calculation, > >> data)] > > > > As charmingly expressive as map() is, the wildly different > > behavior in py3 (it's a generator that evaluates lazily)

[issue28700] test_dbm failure: KeyError: b'0' (intermittent in 3.5, reliable in 3.6)

2017-01-09 Thread Anthony Sottile
Changes by Anthony Sottile : -- nosy: +Anthony Sottile ___ Python tracker ___ ___

Re: Using namedtuples field names for column indices in a list of lists

2017-01-09 Thread Erik
On 10/01/17 00:54, Deborah Swanson wrote: Since I won't change the order of the records again after the sort, I'm using records.sort(key=operator.attrgetter("Description", "Date")) once, which also works perfectly. So both sorted() and sort() can be used to sort namedtuples. Good to know!

[issue29219] TracebackException(capture_locals=True) may fail with RecursionError

2017-01-09 Thread Ilya Kulakov
New submission from Ilya Kulakov: I'm using Python 3.5.2 to be precise. I have code that is roughly equivalent to: import sys import traceback def handle_exception(exc_type, exc_value, exc_traceback): traceback.TracebackException(exc_type, exc_value, exc_traceback,

Re: Clickable hyperlinks

2017-01-09 Thread Joel Goldstick
On Mon, Jan 9, 2017 at 8:33 PM, Michael Torrie wrote: > On 01/09/2017 06:02 PM, Deborah Swanson wrote: >> Fair enough. I only suggested that they could have started their own >> thread, but mainly just to point out that they would have been off-topic >> if they did. I didn't

Announcing txAWS 0.2.3.1

2017-01-09 Thread Jean-Paul Calderone
I've just release txAWS 0.2.3.1. txAWS is a library for interacting with Amazon Web Services (AWS) using Twisted. AWSServiceEndpoint's ssl_hostname_verification's parameter now defaults to True instead of False. This affects all txAWS APIs which issue requests to AWS endpoints. For any

[issue24699] TemporaryDirectory is cleaned up twice

2017-01-09 Thread Ilya Kulakov
Changes by Ilya Kulakov : -- status: open -> closed ___ Python tracker ___ ___

Re: Clickable hyperlinks

2017-01-09 Thread Michael Torrie
On 01/09/2017 06:02 PM, Deborah Swanson wrote: > Fair enough. I only suggested that they could have started their own > thread, but mainly just to point out that they would have been off-topic > if they did. I didn't demand that they do so, I just wanted them to > think about it. I don't see how

RE: Clickable hyperlinks

2017-01-09 Thread Deborah Swanson
Larry Martell wrote, on January 09, 2017 4:11 PM > > On Mon, Jan 9, 2017 at 5:33 PM, Deborah Swanson > wrote: > > Ok, here is the crux of this thread's communication problem. I didn't > > ask, or particularly care for all these lectures on the technology of > >

[issue14102] argparse: add ability to create a man page

2017-01-09 Thread paul j3
Changes by paul j3 : -- nosy: +paul.j3 ___ Python tracker ___ ___ Python-bugs-list

RE: Using namedtuples field names for column indices in a list of lists

2017-01-09 Thread Deborah Swanson
Peter Otten wrote, on January 09, 2017 3:27 PM > > While stable sort is nice in this case you can just say > > key=operator.attrgetter("Description", "Date") > > Personally I'd only use sorted() once and then switch to the > sort() method. This works perfectly, thank you. As I read the docs,

[issue9182] document “--” as a way to distinguish option w/ narg='+' from positional argument in argparse

2017-01-09 Thread paul j3
Changes by paul j3 : -- nosy: +paul.j3 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue14392] type=bool doesn't raise error in argparse.Action

2017-01-09 Thread paul j3
Changes by paul j3 : -- nosy: +paul.j3 ___ Python tracker ___ ___ Python-bugs-list

[issue29218] distutils: Remove unused install_misc class

2017-01-09 Thread Eric N. Vander Weele
Changes by Eric N. Vander Weele : -- components: -Build ___ Python tracker ___ ___

Re: Clickable hyperlinks

2017-01-09 Thread Larry Martell
On Mon, Jan 9, 2017 at 5:33 PM, Deborah Swanson wrote: > Ok, here is the crux of this thread's communication problem. I didn't > ask, or particularly care for all these lectures on the technology of > terminal emulators. I asked how to code Python to make clickable

Re: Using namedtuples field names for column indices in a list of lists

2017-01-09 Thread Peter Otten
breamore...@gmail.com wrote: > On Monday, January 9, 2017 at 5:34:12 PM UTC, Tim Chase wrote: >> On 2017-01-09 08:31, breamoreboy wrote: >> > On Monday, January 9, 2017 at 2:22:19 PM UTC, Tim Chase wrote: >> > > I usually wrap the iterable in something like >> > > >> > > def pairwise(it): >> >

[issue20094] intermitent failures with test_dbm

2017-01-09 Thread Anthony Sottile
Anthony Sottile added the comment: That doesn't seem to be the problem though, that occurs in both the successful and failure case -- ___ Python tracker

[issue20094] intermitent failures with test_dbm

2017-01-09 Thread Anthony Sottile
Anthony Sottile added the comment: Stepping through the code, it seems under ndbm it is creating a file with a '.db' extension: ``` (Pdb) list 47 'g': b'intended', 48 } 49 50 def init_db(self): 51 import pdb; pdb.set_trace() 52

[issue20094] intermitent failures with test_dbm

2017-01-09 Thread Anthony Sottile
Anthony Sottile added the comment: I'm seeing this same failure in python3.5 on 16.04 about 20% of the time: ``` $ python3.5 -m test -v test_dbm == CPython 3.5.2 (default, Nov 17 2016, 17:05:23) [GCC 5.4.0 20160609] == Linux-4.4.0-57-generic-x86_64-with-Ubuntu-16.04-xenial little-endian ==

Re: Using namedtuples field names for column indices in a list of lists

2017-01-09 Thread breamoreboy
On Monday, January 9, 2017 at 5:34:12 PM UTC, Tim Chase wrote: > On 2017-01-09 08:31, breamoreboy wrote: > > On Monday, January 9, 2017 at 2:22:19 PM UTC, Tim Chase wrote: > > > I usually wrap the iterable in something like > > > > > > def pairwise(it): > > > prev = next(it) > > > for

Re: Using namedtuples field names for column indices in a list of lists

2017-01-09 Thread Peter Otten
Rhodri James wrote: > On 09/01/17 21:40, Deborah Swanson wrote: >> Peter Otten wrote, on January 09, 2017 6:51 AM >>> >>> records = sorted( >>> set(records), >>> key=operator.attrgetter("Description") >>> ) >> >> Good, this is confirmation that 'sorted()' is the way to go. I want a 2 >>

Re: Temporary variables in list comprehensions

2017-01-09 Thread Ben Bacarisse
Steven D'Aprano writes: > Suppose you have an expensive calculation that gets used two or more times in > a > loop. The obvious way to avoid calculating it twice in an ordinary loop is > with > a temporary variable: > > result = [] > for x in data: >

[issue29218] distutils: Remove unused install_misc class

2017-01-09 Thread Eric N. Vander Weele
New submission from Eric N. Vander Weele: This class hasn't been used for quite some time. Seems safe to remove. -- components: Build, Distutils files: distutils-remove-install_misc-1.patch keywords: patch messages: 285080 nosy: dstufft, eric.araujo, ericvw, gward priority: normal

[issue29217] Documentation for uuid has wrong description for variant

2017-01-09 Thread David Muller
New submission from David Muller: The documentation's description for uuid.variant says that its value is one of several integer constants, but those constants are actually strings. -- assignee: docs@python components: Documentation messages: 285079 nosy: TigerhawkT3, docs@python

[issue29145] failing overflow checks in replace_*

2017-01-09 Thread Martin Panter
Martin Panter added the comment: Both fixes (join and replace) look good to me. However I don’t think it is necessary to change the exception message in 3.5 or 3.6. -- ___ Python tracker

RE: Clickable hyperlinks

2017-01-09 Thread Deborah Swanson
Tim Chase wrote, on January 09, 2017 5:53 AM > > On 2017-01-09 05:00, Deborah Swanson wrote: > > Code does in fact have the power to control what happens > > in the console. How do you think Linux does it on their terminals with > > clickable links? Granted, the code may have to specify

Re: Using namedtuples field names for column indices in a list of lists

2017-01-09 Thread Rhodri James
On 09/01/17 21:40, Deborah Swanson wrote: Peter Otten wrote, on January 09, 2017 6:51 AM records = sorted( set(records), key=operator.attrgetter("Description") ) Good, this is confirmation that 'sorted()' is the way to go. I want a 2 key sort, Description and Date, but I think I can

[issue29214] Standard open() does not allow to specify file permissions.

2017-01-09 Thread Марк Коренберг
Марк Коренберг added the comment: Such construction is not so easy. Especially for beginners. Not everyone even uses context managers to work with files. They will try to use os.chmod(). More clever will use os.fchmod(fileobj.fileno()). And in rare case someone asks about race condition

RE: Using namedtuples field names for column indices in a list of lists

2017-01-09 Thread Deborah Swanson
breamore...@gmail.com wrote, on January 09, 2017 8:32 AM > > On Monday, January 9, 2017 at 2:22:19 PM UTC, Tim Chase wrote: > > On 2017-01-08 22:58, Deborah Swanson wrote: > > > 1) I have a section that loops through the sorted data, compares two > > > adjacent rows at a time, and marks one of

RE: Using namedtuples field names for column indices in a list of lists

2017-01-09 Thread Deborah Swanson
Tim Chase wrote, on January 09, 2017 6:22 AM > > On 2017-01-08 22:58, Deborah Swanson wrote: > > 1) I have a section that loops through the sorted data, compares two > > adjacent rows at a time, and marks one of them for deletion if the > > rows are identical. > > and my question is whether

[issue29057] Compiler failure on Mac OS X - sys/random.h

2017-01-09 Thread Ned Deily
Ned Deily added the comment: George, did you do totally clean builds, including rerunning ./configure? If so, what ./configure and make commands did you use? Using the current hg repo, I don't see the failures you are seeing. -- ___ Python

RE: Using namedtuples field names for column indices in a list of lists

2017-01-09 Thread Deborah Swanson
Peter Otten wrote, on January 09, 2017 6:51 AM > > Deborah Swanson wrote: > > > Even better, to get hold of all the records with the same Description > > as the current row, compare them all, mark all but the different ones > > for deletion, and then resume processing the records after the

Re: Temporary variables in list comprehensions

2017-01-09 Thread Paul Rubin
Tim Chase writes: >> result = [(tmp, tmp+1) for tmp in map(expensive_calculation, data)] > > As charmingly expressive as map() is, the wildly different behavior in > py3 (it's a generator that evaluates lazily) vs py2 (it consumes the > entire iterable in one go)

[issue29162] pyshell.py: name 'sys' is not defined

2017-01-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I agree that incidental names should be eliminated from import. Could you open a new issue for this? -- ___ Python tracker

[issue28909] Adding LTTng-UST tracing support

2017-01-09 Thread Francis Deslauriers
Francis Deslauriers added the comment: Thanks Łukasz, I will add tests following the example of the DTrace tests and update the Doc/howto/instrumentation.rst file to include this new information. LTTng can be used on all major Linux distros (Ubuntu, Debian, Fedora, etc.) either from

Re: [PSF-Community] Python Events in 2017, Need your help.

2017-01-09 Thread Danny Adair
Thanks Stephane, Kiwi PyCon 2017 will be in Auckland, New Zealand in September - exact dates and location not yet determined. I'll submit it when they are. Cheers, Danny On Mon, Jan 9, 2017 at 10:54 PM, Stephane Wirtel via PSF-Community wrote: > Dear Community, > >

[issue29214] Standard open() does not allow to specify file permissions.

2017-01-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: open(..., opener=partial(os.open, mode=0o644)) Not every combination of functions deserves a new parameter of a builtin. -- ___ Python tracker

RE: Help with this code

2017-01-09 Thread Joaquin Alzola
>> elements. For example, if we have a list_a=["a","b","c","d"] and >> list_b=["a","b"] I want to obtain a new list_c containing elements that >> match between these lists (a and b here), >Perhaps this might work: list(set(list_a).intersection(set(list_b))) >['a', 'b'] >>>

[issue29057] Compiler failure on Mac OS X - sys/random.h

2017-01-09 Thread George King
George King added the comment: (I meant the github mirror: github.com/python/cpython) -- ___ Python tracker ___

[issue29057] Compiler failure on Mac OS X - sys/random.h

2017-01-09 Thread George King
George King added the comment: I am encountering this problem on macOS 10.12.2, with Xcode 8.2.1 (latest). I have tried building from the following cpython branches today (using the github fork): 2.7: 13a39142c047 In file included from ../../Python/random.c:7: /usr/include/sys/random.h:37:32:

[issue29214] Standard open() does not allow to specify file permissions.

2017-01-09 Thread Марк Коренберг
Марк Коренберг added the comment: so, io.open() should just pass that value down to implementation. implementation should use this value instead of hard-coded 0o666. -- ___ Python tracker

[issue29214] Standard open() does not allow to specify file permissions.

2017-01-09 Thread Марк Коренберг
Марк Коренберг added the comment: I expect this: open(, perms=0o644) Why not? -- ___ Python tracker ___

[issue29214] Standard open() does not allow to specify file permissions.

2017-01-09 Thread Brett Cannon
Brett Cannon added the comment: I agree with Serhiy that I don't think this is necessary for io.open() when os.open() supports this. But this really can't be discussed further until someone provides a clear design proposal on how to make this work with io.open(). -- nosy:

Re: Temporary variables in list comprehensions

2017-01-09 Thread Christian Gollwitzer
Am 09.01.17 um 04:53 schrieb Steven D'Aprano: Or do you? ... no, you don't! [(tmp, tmp + 1) for x in data for tmp in [expensive_calculation(x)]] I can't decide whether that's an awesome trick or a horrible hack... I think this is quite clear, and a useful feature, only that Python makes it

[issue29184] skip tests of test_socketserver when bind() raises PermissionError (non-root user on Android)

2017-01-09 Thread Xavier de Gaye
Xavier de Gaye added the comment: New patch following Serhiy's suggestion in msg285008. -- Added file: http://bugs.python.org/file46234/issue29184_01.patch ___ Python tracker

[issue29181] skip tests that raise PermissionError in test_tarfile (non-root user on Android)

2017-01-09 Thread Xavier de Gaye
Xavier de Gaye added the comment: New patch following Serhiy's suggestion in msg285008. -- Added file: http://bugs.python.org/file46233/issue29181_01.patch ___ Python tracker

[issue29180] skip tests that raise PermissionError in test_os (non-root user on Android)

2017-01-09 Thread Xavier de Gaye
Xavier de Gaye added the comment: New patch following Serhiy's suggestion in msg285008. -- Added file: http://bugs.python.org/file46232/issue29180_01.patch ___ Python tracker

[issue28759] access to mkfifo, mknod and hard links is controled by SELinux MAC on Android

2017-01-09 Thread Xavier de Gaye
Xavier de Gaye added the comment: New patch following Serhiy's suggestion in msg285008. -- Added file: http://bugs.python.org/file46231/issue28759-01.patch ___ Python tracker

[issue29214] Standard open() does not allow to specify file permissions.

2017-01-09 Thread Марк Коренберг
Марк Коренберг added the comment: Permissions -- are very important thing. As I think, such high-level functions should not hide that important functionality from end-users. Also, it is not difficult to make a patch (as I think). -- ___ Python

ANN: Bokeh 0.12.4 Released

2017-01-09 Thread Bryan Van de Ven
Hi all, On behalf of the Bokeh team, I am pleased to announce the release of version 0.12.4 of Bokeh! Please see the announcement post at: https://bokeh.github.io/blog/2017/1/6/release-0-12-4/ which has more information as well as live demonstrations. If you are using

Re: Temporary variables in list comprehensions

2017-01-09 Thread Antonio Caminero Garcia
On Sunday, January 8, 2017 at 7:53:37 PM UTC-8, Steven D'Aprano wrote: > Suppose you have an expensive calculation that gets used two or more times in > a > loop. The obvious way to avoid calculating it twice in an ordinary loop is > with > a temporary variable: > > result = [] > for x in

Re: Clickable hyperlinks

2017-01-09 Thread Michael Torrie
On 01/09/2017 10:27 AM, Michael Torrie wrote: >> You can use tkinter (code >> in a program) to make clickable links in the console, > > Unless you're talking about an implementation of a console or terminal > emulator in tkinter, this is incorrect. Tkinter does not do anything > with standard

Re: Help with this code

2017-01-09 Thread Joel Goldstick
On Mon, Jan 9, 2017 at 1:02 PM, Gilmeh Serda wrote: > On Mon, 09 Jan 2017 05:08:51 -0800, José Manuel Suárez Sierra wrote: > >> elements. For example, if we have a list_a=["a","b","c","d"] and >> list_b=["a","b"] I want to obtain a new list_c containing

[issue28414] SSL match_hostname fails for internationalized domain names

2017-01-09 Thread Socob
Changes by Socob <206a8...@opayq.com>: -- nosy: +Socob ___ Python tracker ___ ___ Python-bugs-list mailing

[issue28969] lru_cache is not threadsafe

2017-01-09 Thread INADA Naoki
INADA Naoki added the comment: LGTM -- nosy: +inada.naoki ___ Python tracker ___ ___ Python-bugs-list mailing

[issue17305] IDNA2008 encoding missing

2017-01-09 Thread Socob
Changes by Socob <206a8...@opayq.com>: -- nosy: +Socob ___ Python tracker ___ ___ Python-bugs-list mailing

[issue29214] Standard open() does not allow to specify file permissions.

2017-01-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: io.open() is high-level function. It handles buffering, encoding, newline translating. It is even higher-level than C's fopen(). Syscall open() is low-level. Python os.open() is an interface to this low-level feature. There is a connection between low and

[issue28870] Reduce stack consumption of PyObject_CallFunctionObjArgs() and like

2017-01-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I'm not sure that the result of pyobjectl_callfunctionobjargs_stacksize() has direct relation to stack consumption in test_python_call, test_python_getitem and test_python_iterator. Try to measure the stack consumption in these cases. This can be done with

Re: Search a sequence for its minimum and stop as soon as the lowest possible value is found

2017-01-09 Thread Peter Otten
Antonio Caminero Garcia wrote: > On Friday, January 6, 2017 at 6:04:33 AM UTC-8, Peter Otten wrote: >> Example: you are looking for the minimum absolute value in a series of >> integers. As soon as you encounter the first 0 it's unnecessary extra >> work to check the remaining values, but the

[issue29154] 5 failures in test_doctest: ModuleNotFoundError: No module named 'IPython'

2017-01-09 Thread Eric Snow
Eric Snow added the comment: There shouldn't be anything in CPython that depends on IPython. I'd recommend checking for $PYTHONSTARTUP, in site.py, and for .pth files in directories on sys.path. Also look for .py files in the current directory that are shadowing stdlib modules. Any of

[issue29216] Space saving step for the LRU cache

2017-01-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Ah, there is a wart in the optimization in Python implementation. If call a cached function with multiple integer arguments and with equivalent float arguments, the second call will return a cached result. But if call with single integer and float

Re: Clickable hyperlinks

2017-01-09 Thread Michael Torrie
On 01/09/2017 06:00 AM, Deborah Swanson wrote: > Rhodri James wrote, on January 09, 2017 4:28 AM >> >> Nope. PyCharm outputs text to the console that the console >> chooses to >> interpret as a link and makes clickable. As Stephen pointed >> out right >> back at the beginning of this thread,

[issue28870] Reduce stack consumption of PyObject_CallFunctionObjArgs() and like

2017-01-09 Thread STINNER Victor
STINNER Victor added the comment: Impact of the _PY_FASTCALL_SMALL_STACK constant: * _PY_FASTCALL_SMALL_STACK=1: 528 bytes/call test_python_call 7376 test_python_getitem 6544 test_python_iterator 5572 => total: 19 492 * _PY_FASTCALL_SMALL_STACK=3: 528 bytes/call test_python_call 7272

Re: Temporary variables in list comprehensions

2017-01-09 Thread Tim Chase
On 2017-01-09 04:59, Rustom Mody wrote: > What happens when the expensive is on an inner generator? > Something like: > > [expensive₂(y) for x in data for y in foo(x)] > > [The ₂ representing the 2 or more occurrences in Steven's eg] Well, if I understand your question correctly, the goal

  1   2   >