Re: Proposed new syntax

2017-08-19 Thread Chris Angelico
On Sun, Aug 20, 2017 at 2:28 PM, Rustom Mody wrote: > So if Chris can answer how to teach music to a tone-deaf person, I can > consider how to answer the question of how to teach programming to a > math-challenged one You don't HAVE to understand math to be a programmer.

Re: Proposed new syntax

2017-08-19 Thread Paul Rubin
Rustom Mody writes: > Specifically the term 'comprehension' used today as a programming construct > traces somewhat tenuously to an axiom that Zermelo/Fraenkel formulated > in the 1920s I thought went back to Frege. Also, it appears in Zermelo set theory Z. ZF is Z with

[issue31118] Make super() work with staticmethod by using __class__ for both arguments to super()

2017-08-19 Thread Nick Coghlan
Nick Coghlan added the comment: Thanks for the suggestion, but I'm closing this RFE, as there are two strong arguments against it: one related to implementation feasibility, and one related to the nature of what super() *does*. The feasibility argument is that the compiler doesn't even have

[issue31240] Add lazy evaluation support for dict.setdefault()

2017-08-19 Thread Jim Dennis
New submission from Jim Dennis: Code such as mydict.setdefault('eggs', []) will needlessly incur the cost of instantiating a list even when 'eggs' is already a valid key in mydict. collections.defaultdict will not do this. detecting and automatically calling "callable" and "type" objects

Re: Proposed new syntax

2017-08-19 Thread Rustom Mody
On Saturday, August 19, 2017 at 9:45:48 AM UTC+5:30, Steve D'Aprano wrote: > On Sat, 19 Aug 2017 12:59 am, Chris Angelico wrote: > > > On Fri, Aug 18, 2017 at 11:46 PM, Rustom Mody wrote: > >> Compare the well-known haskell tutorial > >> http://learnyouahaskell.com/starting-out > >> whose

[issue29302] add contextlib.AsyncExitStack

2017-08-19 Thread Nick Coghlan
Nick Coghlan added the comment: While it *may* be possible to do something simpler for test purposes where performance isn't a major concern, fully supporting type() level mocking basically requires bringing the equivalent of wrapt object proxies into the standard library:

[issue31118] Make super() work with staticmethod by using __class__ for both arguments to super()

2017-08-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: Do you have a use case? This seems doesn't seem like it would be helpful at all and would make super a little more confusing than it already is. -- nosy: +rhettinger ___ Python tracker

[issue5004] socket.getfqdn() doesn't cope properly with purely DNS-based setups

2017-08-19 Thread devurandom
devurandom added the comment: In my case, /etc/hostname, /proc/sys/kernel/hostname, `uname -n`, `hostname -f` all show the same FQDN, but `python -c 'import socket ; print(socket.getfqdn())'` still prints the short hostname. /etc/hosts is empty except for localhost. /etc/nsswitch.conf

[issue5004] socket.getfqdn() doesn't cope properly with purely DNS-based setups

2017-08-19 Thread devurandom
Changes by devurandom : -- nosy: +devurandom ___ Python tracker ___ ___ Python-bugs-list

[issue31206] IDLE, configdialog: Factor out HighPage class from ConfigDialog

2017-08-19 Thread Terry J. Reedy
Terry J. Reedy added the comment: Ditto last message for PR3156 and 3rd patch deleting old code now dead. In retrospect, we could have done first and second patches together. Deleting or commenting out a large existing block along with other changes triggers the nonsense diff. Let's see

[issue31206] IDLE, configdialog: Factor out HighPage class from ConfigDialog

2017-08-19 Thread Terry J. Reedy
Terry J. Reedy added the comment: New changeset 8f7a798edbdbca9a400105e3225463e59b334666 by Terry Jan Reedy (Cheryl Sabella) in branch 'master': bpo-31206: IDLE: Factor HighPage class from ConfigDialog (#3156) https://github.com/python/cpython/commit/8f7a798edbdbca9a400105e3225463e59b334666

Re: how to create root with treelib?

2017-08-19 Thread MRAB
On 2017-08-20 01:58, Ho Yeung Lee wrote: http://treelib.readthedocs.io/en/latest/examples.html tree = Tree() #create root tree.create_node((0,0), "root") result = [aa[0]] previousnode = (0,0) #create root ... tree.create_node((0,0), "root") Traceback (most recent call last): File "", line

how to create root with treelib?

2017-08-19 Thread Ho Yeung Lee
http://treelib.readthedocs.io/en/latest/examples.html tree = Tree() #create root tree.create_node((0,0), "root") result = [aa[0]] previousnode = (0,0) >>> #create root ... tree.create_node((0,0), "root") Traceback (most recent call last): File "", line 2, in File

Re: Proposed new syntax

2017-08-19 Thread Steve D'Aprano
On Sat, 19 Aug 2017 03:42 pm, Chris Angelico wrote: >> [1] Assuming that mathematics actually is sound, which thanks to Gödel we >> [know >> is unprovable. > > Harmony in audio signals is based on frequency ratios. Therefore sound > is mathematics, and by the reflexive principle of equality, >

[issue29843] errors raised by ctypes.Array for invalid _length_ attribute

2017-08-19 Thread Igor
Igor added the comment: Oren, 1) I might be completely wrong, but, personally, I think about OverflowError vs ValueError difference like this: if the value couldn't be handled because method's logic cannot handle it - it's a ValueError; if it could not be handled because of a low-level

Re:

2017-08-19 Thread Bob Gailer
Unfortunately the images did not come through, since this is a text-only email list. I suggest you put your images on an online resource such as Photobucket and post the links in your email. Unfortunately your description of the problem is not very precise. Obviously the images would help. Terms

Re: Default .py program and Edit with IDLE problem

2017-08-19 Thread Rick Johnson
alister wrote: > Steve D'Aprano wrote: > > Rick Johnson wrote: [...] > I think to a point I have to agree with rick, Well, alister, i'll take what i can get around here. :-) > windows installers can be flaky and time is money. Indeed. > if something does not work after installation (& does

[no subject]

2017-08-19 Thread Owen Berry
I'm new to python and having trouble with the most basic step. I have tried to install python (Web-based installer) on my home pc to mess around and attempt to develop a program. when I install the launcher it is fine but when I try and open the file it launches a modify setup window. I have no

Re: Proposed new syntax

2017-08-19 Thread Chris Angelico
On Sat, Aug 19, 2017 at 2:15 PM, Steve D'Aprano wrote: > Indeed. People find imperative (recipe) algorithms easy to follow, and pure > functional reasoning hard. I'm glad that functional programming is fashionable > again, and hope that people will learn good habits

Re: A question on modification of a list via a function invocation

2017-08-19 Thread breamoreboy
On Saturday, August 19, 2017 at 11:59:41 AM UTC+1, Steve D'Aprano wrote: > Consider that in my family, one of our most precious heirlooms is the axe of > my > great-great-great grandfather, which we have passed down from eldest son to > eldest son for generations. > > The axe is now almost 200

Re: Default .py program and Edit with IDLE problem

2017-08-19 Thread alister via Python-list
On Sun, 20 Aug 2017 01:56:14 +1000, Steve D'Aprano wrote: > On Sun, 20 Aug 2017 12:11 am, Rick Johnson wrote: > >> On Saturday, August 19, 2017 at 5:39:19 AM UTC-5, Chris Angelico wrote: >>> I'm not sure how "refuse to guess" translates into "wipe it out and >>> start over". I *never* recommend

Re: Default .py program and Edit with IDLE problem

2017-08-19 Thread Rick Johnson
Steve D'Aprano wrote: > Rick Johnson wrote: > > Chris Angelico wrote: > > > I'm not sure how "refuse to guess" translates into "wipe > > > it out and start over". I *never* recommend > > > uninstall/reinstall as a first measure. It's a stupid > > > idea unless you actually know that it's going to

[issue31109] zipimport argument clinic conversion

2017-08-19 Thread Brett Cannon
Changes by Brett Cannon : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___

[issue29302] add contextlib.AsyncExitStack

2017-08-19 Thread Yury Selivanov
Yury Selivanov added the comment: >> but at the same time rejected by the 'async with' statement. > Perhaps unittest.mock (or type) needs to be adjusted to allow mocking via > spec= without subclassing? Maybe. You should try to find discussions around this topic on python mailing lists and

[issue29302] add contextlib.AsyncExitStack

2017-08-19 Thread Ilya Kulakov
Ilya Kulakov added the comment: > but at the same time rejected by the 'async with' statement. Perhaps unittest.mock (or type) needs to be adjusted to allow mocking via spec= without subclassing? > By all means you can submit a PR! I'll take a look then. --

[issue31230] Define a general "asynchronous operation introspection" protocol

2017-08-19 Thread Yury Selivanov
Yury Selivanov added the comment: > I started a local PR at https://github.com/ncoghlan/cpython/pull/1/files to > explore what this might look like in practice. Looks good to me. > I'm less sure about __delegated_to__/__returns_to__, since we don't have > *any* code in the standard library

[issue29302] add contextlib.AsyncExitStack

2017-08-19 Thread Yury Selivanov
Yury Selivanov added the comment: > I'm not sure about type() to get a class object and calling __aenter__, > __aexit__ through it: that makes it hard to mock these classes as Mock's > spec= relies on __class__ and type() seem to ignore it (learned it a hard way. Looking up __dunder__ methods

Re: Default .py program and Edit with IDLE problem

2017-08-19 Thread Steve D'Aprano
On Sun, 20 Aug 2017 12:11 am, Rick Johnson wrote: > On Saturday, August 19, 2017 at 5:39:19 AM UTC-5, Chris Angelico wrote: >> I'm not sure how "refuse to guess" translates into "wipe it >> out and start over". I *never* recommend >> uninstall/reinstall as a first measure. It's a stupid idea >>

[issue30923] Add -Wimplicit-fallthrough=0 to Makefile ?

2017-08-19 Thread Stefan Krah
Stefan Krah added the comment: PR 3157 addresses everything apart from expat and https://github.com/python/cpython/blob/master/Modules/cjkcodecs/_codecs_iso2022.c#L816 I'm not sure about that one. It looks harmless but a bit odd. -- ___ Python

[issue30923] Add -Wimplicit-fallthrough=0 to Makefile ?

2017-08-19 Thread Stefan Krah
Changes by Stefan Krah : -- pull_requests: +3194 ___ Python tracker ___ ___

Re: What extended ASCII character set uses 0x9D?

2017-08-19 Thread Gregory Ewing
Ian Kelly wrote: One possibility is that it's the same two bytes. That would make it 0xE2 0x80 0x9D which is "right double quotation mark". Since it keeps appearing after ending double quotes that seems plausible, although one has to wonder why it appears *in addition to* the ASCII double

Re: A question on modification of a list via a function invocation

2017-08-19 Thread Rick Johnson
Steve D'Aprano wrote: > I'm not sure that the VIN defines the vehicle exactly... I > wouldn't want to try driving a VIN without the rest of the > vehicle. The mileage is terrible... Quoting Fredrik Lundh: > well, I guess you can, in theory, value an artificial > number assigned to an object as

Re: Default .py program and Edit with IDLE problem

2017-08-19 Thread Rick Johnson
On Saturday, August 19, 2017 at 5:39:19 AM UTC-5, Chris Angelico wrote: > I'm not sure how "refuse to guess" translates into "wipe it > out and start over". I *never* recommend > uninstall/reinstall as a first measure. It's a stupid idea > unless you actually know that it's going to help. No,

[issue5001] Remove assertion-based checking in multiprocessing

2017-08-19 Thread drallensmith
drallensmith added the comment: I've updated the PR to include all of the non-Windows-specific asserts; I am not sufficiently familiar with Windows multiprocessing to feel confident writing informative error messages. -- ___ Python tracker

[issue31205] IDLE, configdialog: Factor out KeysPage class from ConfigDialog

2017-08-19 Thread Terry J. Reedy
Terry J. Reedy added the comment: New changeset 764e282158df0d7d6d7e0c72f38756c979a36539 by Terry Jan Reedy (Cheryl Sabella) in branch '3.6': [3.6] bpo-31206: IDLE: Factor HighPage class from ConfigDialog (GH-3141) (#3154)

[issue31206] IDLE, configdialog: Factor out HighPage class from ConfigDialog

2017-08-19 Thread Terry J. Reedy
Terry J. Reedy added the comment: New changeset 764e282158df0d7d6d7e0c72f38756c979a36539 by Terry Jan Reedy (Cheryl Sabella) in branch '3.6': [3.6] bpo-31206: IDLE: Factor HighPage class from ConfigDialog (GH-3141) (#3154)

[ANN] aiounittest 1.0.1 released

2017-08-19 Thread Krzysztof Warunek
hi, I'm happy to announce the first (public) release of aiounittest. PyPi: https://pypi.python.org/pypi/aiounittest Github: https://github.com/kwarunek/aiounittest This is a helper library to ease of your pain (and boilerplate) when writing tests of the asynchronous code (asyncio). It

[issue14976] queue.Queue() is not reentrant, so signals and GC can cause deadlocks

2017-08-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: Le 19/08/2017 à 12:09, Nick Coghlan a écrit : > > Would it be feasible to change the behaviour of non-reentrant locks such that: > > 1. They *do* keep track of the owning thread Yes. > 2. Trying to acquire them again when the current thread already has them

PyDev 5.9.2 released

2017-08-19 Thread Fabio Zadrozny
PyDev 5.9.2 Release Highlights - *Important* PyDev now requires Java 8 and Eclipse 4.6 (Neon) onwards. - PyDev 5.2.0 is the last release supporting Eclipse 4.5 (Mars). - *Debugger* - Integrated speedups for Python 3.6 which use the new Python hook which allows the

cx_Oracle 6.0.1

2017-08-19 Thread Anthony Tuininga
What is cx_Oracle? cx_Oracle is a Python extension module that enables access to Oracle Database for Python 3.x and 2.x and conforms to the Python database API 2.0 specifications with a number of enhancements. Where do I get it? https://oracle.github.io/python-cx_Oracle The easiest method to

[issue31230] Define a general "asynchronous operation introspection" protocol

2017-08-19 Thread Nick Coghlan
Nick Coghlan added the comment: I started a local PR at https://github.com/ncoghlan/cpython/pull/1/files to explore what this might look like in practice. I think that what I've done so far shows that generic __frame__ and __running__ attributes would be sufficient to extend the inspect

[issue31183] `Dis` module doesn't know how to disassemble async generator or coroutine objects

2017-08-19 Thread Nick Coghlan
Nick Coghlan added the comment: Thanks for the patch! Issue 31230 is a follow-up issue looking at whether or not we should define a general "__code__" attribute as a general purpose introspection protocol for disassembly support (amongst other generalisations of state introspection support

[issue31183] `Dis` module doesn't know how to disassemble async generator or coroutine objects

2017-08-19 Thread Nick Coghlan
Changes by Nick Coghlan : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue31120] [2.7] Python 64 bit _ssl compile fails due missing buildinf_amd64.h

2017-08-19 Thread Hiren Vadalia
Hiren Vadalia added the comment: Hey Zach, Any update on this? -- ___ Python tracker ___ ___

Re: A question on modification of a list via a function invocation

2017-08-19 Thread Steve D'Aprano
On Sat, 19 Aug 2017 08:07 pm, Rick Johnson wrote: > And why is that so difficult for you to understand? It has > always seemed perfectly logical to me... > > [A thought experiment] > Consider automobiles as an example. Automobiles are > constructed in factories, and they are machines that are >

Re: Default .py program and Edit with IDLE problem

2017-08-19 Thread Chris Angelico
On Sat, Aug 19, 2017 at 7:43 PM, Rick Johnson wrote: > Don't waste your time with that stupid "repair option". What > does an uninstall and reinstall process take these days... > all of two minutes? > > Oh boy... The first rule of troubleshooting is always to > apply

Re: A question on modification of a list via a function invocation

2017-08-19 Thread Rick Johnson
On Wednesday, August 16, 2017 at 4:07:14 PM UTC-5, Mok-Kong Shen wrote: > The above shows that with , i.e. assigning > single values to individual members of alist (with > alist[0]=3 etc.) is "principally" different from assigning > a whole list to alist (with alist=[30,60,90]). The first >

[issue14976] queue.Queue() is not reentrant, so signals and GC can cause deadlocks

2017-08-19 Thread Nick Coghlan
Nick Coghlan added the comment: Would it be feasible to change the behaviour of non-reentrant locks such that: 1. They *do* keep track of the owning thread 2. Trying to acquire them again when the current thread already has them locked raises RuntimeError instead of deadlocking the way it does

[issue29456] bugs in unicodedata.normalize: u1176, u11a7 and u11c3

2017-08-19 Thread Wonsup Yoon
Wonsup Yoon added the comment: This patch fixes changes in Unicode 4.1.0. I think it well reviewed and it is time to merge. Who can commit this patch? @animalize says: Let me give a supplement: Before Unicode 4.1.0 (draft), here is: TBase <= code <= TBase+TCount see:

Re: Default .py program and Edit with IDLE problem

2017-08-19 Thread Rick Johnson
On Wednesday, August 16, 2017 at 4:55:17 PM UTC-5, Kevi Aday (Katch22) wrote: > I installed python 3.6.2 for making running and editing > programs. Later on I installed python 2.7 because a program > that I downloaded only works with that. Later I deleted the > program. I then wanted to run a

[issue31206] IDLE, configdialog: Factor out HighPage class from ConfigDialog

2017-08-19 Thread Cheryl Sabella
Changes by Cheryl Sabella : -- pull_requests: +3193 ___ Python tracker ___ ___

[issue14976] queue.Queue() is not reentrant, so signals and GC can cause deadlocks

2017-08-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: Oh and: Le 18/08/2017 à 23:26, Guido van Rossum a écrit : > > I can't say I understand all of Antoine's patch, but it's probably okay to do > it this way; however I would rather see if we can add _is_owned() to Lock, > assuming it can be implemented using

[issue14976] queue.Queue() is not reentrant, so signals and GC can cause deadlocks

2017-08-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: Le 18/08/2017 à 23:26, Guido van Rossum a écrit : > > IIUC the end result would be a Queue whose put() works from signal handlers, > GC callbacks and __del__, as long as it's unbounded, right? Yes. > And when it *is* bounded, it will give a decent message if

[issue29843] errors raised by ctypes.Array for invalid _length_ attribute

2017-08-19 Thread Oren Milman
Oren Milman added the comment: I am not sure I understood your question, Igor. I compiled with https://github.com/python/cpython/pull/3006, and got: class T(ctypes.Array): _type_ = ctypes.c_int _length_ = 2 ** 1000 Traceback (most recent call last): File "", line

[issue29302] add contextlib.AsyncExitStack

2017-08-19 Thread Ilya Kulakov
Ilya Kulakov added the comment: I'm not sure about type() to get a class object and calling __aenter__, __aexit__ through it: that makes it hard to mock these classes as Mock's spec= relies on __class__ and type() seem to ignore it (learned it a hard way. Yury, I could take a second look and

[issue31239] namedtuple comparison ignores types

2017-08-19 Thread R. David Murray
R. David Murray added the comment: This is by design: namedtuples are tuples in which you can access the elements by name. If you have a tuple with the same elements, but no name access, they should compare equal, because they are fundamentally tuples. The names are just a convenience.

[issue31232] Backport the new custom "print >> sys.stderr" error message?

2017-08-19 Thread Nick Coghlan
Nick Coghlan added the comment: Thanks all! -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___

[issue30721] Show expected input for right shift operator usage in custom "print" error message

2017-08-19 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset 1a05e87ec75436d818f05a5dabcecaea67334cbd by Nick Coghlan in branch '3.6': [3.6] bpo-31232: Backport custom print rshift message (GH-3155) https://github.com/python/cpython/commit/1a05e87ec75436d818f05a5dabcecaea67334cbd --

[issue31232] Backport the new custom "print >> sys.stderr" error message?

2017-08-19 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset 1a05e87ec75436d818f05a5dabcecaea67334cbd by Nick Coghlan in branch '3.6': [3.6] bpo-31232: Backport custom print rshift message (GH-3155) https://github.com/python/cpython/commit/1a05e87ec75436d818f05a5dabcecaea67334cbd --

[issue14976] queue.Queue() is not reentrant, so signals and GC can cause deadlocks

2017-08-19 Thread Nick Coghlan
Nick Coghlan added the comment: +1 for treating Queue.put() specifically as the case to be handled, as that's the mechanism that can be used to *avoid* running complex operations directly in __del__ methods and weakref callbacks. For testing purposes, the current deadlock can be reliably

[issue30721] Show expected input for right shift operator usage in custom "print" error message

2017-08-19 Thread Nick Coghlan
Changes by Nick Coghlan : -- pull_requests: +3192 ___ Python tracker ___ ___

[issue31232] Backport the new custom "print >> sys.stderr" error message?

2017-08-19 Thread Nick Coghlan
Changes by Nick Coghlan : -- pull_requests: +3191 ___ Python tracker ___ ___

[issue31232] Backport the new custom "print >> sys.stderr" error message?

2017-08-19 Thread Nick Coghlan
Nick Coghlan added the comment: The condition we (mostly Serhiy) came up with for the check is actually kinda neat, since it's based on the value of the LHS and is hard to trigger accidentally: ``` >>> printf = print >>> print = 10 >>> print >> 1 5 >>> printf >> 1 Traceback (most recent call