Re: [Python-ideas] Sets, Dictionaries

2018-03-29 Thread Nick Coghlan
On 30 March 2018 at 02:04, Clint Hepner wrote: > >> On 2018 Mar 29 , at 11:42 a, Julia Kim wrote: >> >> My suggestion is to change the syntax for creating an empty set and an empty >> dictionary as following. >> >> an_empty_set = {} >>

Re: [Python-ideas] Fixing class scope brainstorm

2018-03-29 Thread Nick Coghlan
On 30 March 2018 at 02:53, Paul Moore wrote: > On 29 March 2018 at 16:27, Nick Coghlan wrote: >> On 28 March 2018 at 04:47, Paul Moore wrote: >>> To me, that would be the ideal. I assume there are significant >>> technical

Re: [Python-ideas] Sets, Dictionaries

2018-03-29 Thread Clint Hepner
> On 2018 Mar 29 , at 12:06 p, Chris Angelico wrote: > > On Fri, Mar 30, 2018 at 3:00 AM, Stephan Houben wrote: >> Perhaps one day we will be able to use >> >> ∅ >> >> for the empty set. >> That would actually match conventional notation. >> > >

Re: [Python-ideas] Sets, Dictionaries

2018-03-29 Thread Chris Barker - NOAA Federal
> There are two chances of this happening, zero or none. That would be the empty set, yes? ;-) -CHB ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct:

Re: [Python-ideas] threading lock and isinstance

2018-03-29 Thread Guido van Rossum
You should probably first explain your use case -- why is it important to your code to be able to use isinstance() on locks? On Thu, Mar 29, 2018 at 2:43 AM, Jacco van Dorp wrote: > Currently, you cannot use isinstance checks on threading locks, because > they're created

Re: [Python-ideas] Sets, Dictionaries

2018-03-29 Thread Mark Lawrence
On 29/03/18 16:42, Julia Kim wrote: My suggestion is to change the syntax for creating an empty set and an empty dictionary as following. an_empty_set = {} an_empty_dictionary = {:} Compatibility issues could be resolved with a program which takes a Python program (codes) as a text and

Re: [Python-ideas] Fixing class scope brainstorm

2018-03-29 Thread Paul Moore
On 29 March 2018 at 16:27, Nick Coghlan wrote: > On 28 March 2018 at 04:47, Paul Moore wrote: >> To me, that would be the ideal. I assume there are significant >> technical challenges, though, as otherwise I'd have thought that would >> have been the

Re: [Python-ideas] Sets, Dictionaries

2018-03-29 Thread Chris Angelico
On Fri, Mar 30, 2018 at 3:00 AM, Stephan Houben wrote: > Perhaps one day we will be able to use > > ∅ > > for the empty set. > That would actually match conventional notation. > Maybe, but that symbol generally means the unique immutable empty set in mathematics, so a

Re: [Python-ideas] Sets, Dictionaries

2018-03-29 Thread Clint Hepner
> On 2018 Mar 29 , at 11:42 a, Julia Kim wrote: > > My suggestion is to change the syntax for creating an empty set and an empty > dictionary as following. > > an_empty_set = {} > an_empty_dictionary = {:} If you are willing to accept {:} as an empty dict, then

Re: [Python-ideas] Sets, Dictionaries

2018-03-29 Thread Stephan Houben
Perhaps one day we will be able to use ∅ for the empty set. That would actually match conventional notation. Note that this is not valid syntax today (not a legal Unicode identifier). Stephan Op do 29 mrt. 2018 17:49 schreef Chris Angelico : > On Fri, Mar 30, 2018 at 2:42

Re: [Python-ideas] Sets, Dictionaries

2018-03-29 Thread Chris Angelico
On Fri, Mar 30, 2018 at 2:42 AM, Julia Kim wrote: > My suggestion is to change the syntax for creating an empty set and an empty > dictionary as following. > > an_empty_set = {} > an_empty_dictionary = {:} > > > Compatibility issues could be resolved with a program

[Python-ideas] Sets, Dictionaries

2018-03-29 Thread Julia Kim
My suggestion is to change the syntax for creating an empty set and an empty dictionary as following. an_empty_set = {} an_empty_dictionary = {:} Compatibility issues could be resolved with a program which takes a Python program (codes) as a text and edits it. Sent from my iPhone

Re: [Python-ideas] Fixing class scope brainstorm

2018-03-29 Thread Nick Coghlan
On 28 March 2018 at 04:47, Paul Moore wrote: > On 27 March 2018 at 19:43, Ethan Furman wrote: >> On 03/27/2018 11:12 AM, Ivan Levkivskyi wrote: >>> >>> On 27 March 2018 at 18:19, Guido van Rossum wrote: >> Hm, so maybe we shouldn't touch lambda, but

Re: [Python-ideas] Fixing class scope brainstorm

2018-03-29 Thread Nick Coghlan
On 28 March 2018 at 03:19, Guido van Rossum wrote: > On Tue, Mar 27, 2018 at 6:56 AM, Nick Coghlan wrote: >> >> [...] The implicit functions used in the >> comprehension & generator expression cases are just potentially >> simpler to handle, as we don't care

Re: [Python-ideas] PEP 572 version 2: Statement-Local Name Bindings

2018-03-29 Thread Nick Coghlan
On 28 March 2018 at 00:52, Ethan Furman wrote: > On 03/25/2018 09:46 AM, Ethan Furman wrote: >> >> On 03/24/2018 09:24 PM, Nick Coghlan wrote: >> >>> No, the fact that the expression defining the outermost iterable gets >>> evaluated in the outer scope is behaviour that's >>>

Re: [Python-ideas] Fixing class scope brainstorm

2018-03-29 Thread Brice Parent
Hm, so maybe we shouldn't touch lambda, but we can at least fix the scope issues for comprehensions and genexprs. There may still be breakage, when the code defines a global x that is overridden by a class-level x, and a class-level comprehension references x assuming it to be the global.

[Python-ideas] threading lock and isinstance

2018-03-29 Thread Jacco van Dorp
Currently, you cannot use isinstance checks on threading locks, because they're created by a factory function instead of being actual classes. Now that we've got __subclasshook__ and __instancecheck__, is there still a reason other than "history" that we can't use isinstance here ? There could