Re: [Python-ideas] Asynchronous exception handling around with/try statement borders

2017-06-29 Thread Greg Ewing
Nathaniel Smith wrote: A magic (implemented in C) decorator like @async_signals_masked I think would be the simplest way to do this extension. I don't have a good feeling about that approach. While implementing the decorator in C might be good enough in CPython to ensure no window of opportunit

Re: [Python-ideas] Runtime types vs static types

2017-06-29 Thread Ivan Levkivskyi
Sorry, I was not able to completely digest the OP, but I think there are some points I need to clarify. 1. Distinction between runtime classes and static types is quite sane and a simple idea. A runtime class is something associated with an actual object, while static type is something associated

Re: [Python-ideas] Runtime types vs static types

2017-06-29 Thread Koos Zevenhoven
On Thu, Jun 29, 2017 at 12:40 PM, Ivan Levkivskyi wrote: > Sorry, I was not able to completely digest the OP, but I think there are > some points I need to clarify. > > 1. Distinction between runtime classes and static types is quite sane and > a simple idea. > A runtime class is something associ

Re: [Python-ideas] + operator on generators

2017-06-29 Thread Jan Kaliszewski
2017-06-27 Stephan Houben dixit: > Is "itertools.chain" actually that common? > Sufficiently common to warrant its own syntax? Please, note that it can be upturned: maybe they are not so common as they could be because of all that burden with importing from separate module -- after all we are sa

Re: [Python-ideas] + operator on generators

2017-06-29 Thread Jan Kaliszewski
2017-06-25 Serhiy Storchaka dixit: > 25.06.17 15:06, lucas via Python-ideas пише: > > I often use generators, and itertools.chain on them. > > What about providing something like the following: > > > > a = (n for n in range(2)) > > b = (n for n in range(2, 4)) > > tuple(a + b) #

[Python-ideas] Python 4: Concatenation

2017-06-29 Thread Soni L.
Step 1. get rid of + for strings, lists, etc. (string/list concatenation is not addition) Step 2. add concatenation operator for strings, lists, and basically anything that can be iterated. effectively an overloadable itertools.chain. (list cat list = new list, not iterator, but effectively m

Re: [Python-ideas] Python 4: Concatenation

2017-06-29 Thread Chris Angelico
On Fri, Jun 30, 2017 at 9:33 AM, Soni L. wrote: > Step 1. get rid of + for strings, lists, etc. (string/list concatenation is > not addition) > > Step 2. add concatenation operator for strings, lists, and basically > anything that can be iterated. effectively an overloadable itertools.chain. > (li

Re: [Python-ideas] Python 4: Concatenation

2017-06-29 Thread Steven D'Aprano
On Thu, Jun 29, 2017 at 08:33:12PM -0300, Soni L. wrote: > Step 1. get rid of + for strings, lists, etc. (string/list concatenation > is not addition) I agree that using + for concatenation is sub-optimal, & is a better choice, but we're stuck with it. And honestly it's not *that* big a deal t

Re: [Python-ideas] Python 4: Concatenation

2017-06-29 Thread [email protected]
I feel like this would literally break the world for almost no real benefit... -- Ryan (ライアン) Yoko Shimomura, ryo (supercell/EGOIST), Hiroyuki Sawano >> everyone elsehttp://refi64.com On Jun 29, 2017 at 6:33 PM, > wrote: Step 1. get rid of + for strings, lists, etc. (string/list concatenation i

Re: [Python-ideas] Python 4: Concatenation

2017-06-29 Thread Soni L.
On 2017-06-29 09:48 PM, Steven D'Aprano wrote: On Thu, Jun 29, 2017 at 08:33:12PM -0300, Soni L. wrote: Step 1. get rid of + for strings, lists, etc. (string/list concatenation is not addition) I agree that using + for concatenation is sub-optimal, & is a better choice, but we're stuck with

Re: [Python-ideas] Python 4: Concatenation

2017-06-29 Thread Chris Angelico
On Fri, Jun 30, 2017 at 12:14 PM, Soni L. wrote: > This isn't a *major* backwards incompatibility. Unlike with unicode/strings, > a dumb static analysis program can trivially replace + with the > concatenation operator, whatever that may be. Technically, nothing forces us > to remove + from string

[Python-ideas] Python 4: Concatenation

2017-06-29 Thread electron
-- Forwarded message -- From: Chris Angelico Date: Fri, Jun 30, 2017 at 9:12 AM Subject: Re: [Python-ideas] Python 4: Concatenation To: electron On Fri, Jun 30, 2017 at 2:38 PM, electron wrote: > On Fri, Jun 30, 2017 at 8:30 AM, Chris Angelico wrote: >> >> Your challenge: Find

Re: [Python-ideas] Python 4: Concatenation

2017-06-29 Thread Nick Coghlan
On 30 June 2017 at 09:33, Soni L. wrote: > Step 4. make it into python 4, since it breaks backwards compatibility. If a Python 4.0 ever happens, it will abide by the usual feature release compatibility restrictions (i.e. anything that it drops will have gone through programmatic deprecation in pr

Re: [Python-ideas] Python 4: Concatenation

2017-06-29 Thread Steven D'Aprano
On Thu, Jun 29, 2017 at 11:14:46PM -0300, Soni L. wrote: > astring cat alist is undefined for string (since strings are very > specific about types), so it would return a list. > > alist cat atuple would return a list, because the list comes first. This would be strongly unacceptable to me. If