Re: [Python-ideas] PEP 525: Asynchronous Generators

2016-08-24 Thread Yury Selivanov
On 2016-08-16 12:46 PM, Moritz Sichert via Python-ideas wrote: 2. It's extremely unlikely that somebody will design a system that switches coroutine runners *while async/awaiting a coroutine*. Yes, I guess so. But even in this unlikely use case, you can easily stack finalizers following this

[Python-ideas] Adding optional parameter to shutil.rmtree to not delete root.

2016-08-24 Thread Nick Jacobson via Python-ideas
I've been finding that a common scenario is where I want to remove everything in a directory, but leave the (empty) root directory behind, not removing it. So for example, if I have a directory C:\foo and it contains subdirectory C:\foo\bar and file C:\foo\myfile.txt, and I want to remove the sub

[Python-ideas] SI scale factors in Python

2016-08-24 Thread Ken Kundert
All, I propose that support for SI scale factors be added to Python. This would be very helpful for any program that heavily uses real numbers, such as those involved with scientific and engineering computation. There would be two primary changes. First, the lexer would be enhanced to take rea

Re: [Python-ideas] SI scale factors in Python

2016-08-24 Thread Random832
On Thu, Aug 25, 2016, at 00:28, Ken Kundert wrote: > Basically a scale factor and units may follow a number, both of which are > optional, but if the units are given the scale factor must also be given. So you can have 1000mm or 0.001km but not 1m? ___ P

Re: [Python-ideas] SI scale factors in Python

2016-08-24 Thread Ian Kelly
On Wed, Aug 24, 2016 at 10:34 PM, Random832 wrote: > On Thu, Aug 25, 2016, at 00:28, Ken Kundert wrote: >> Basically a scale factor and units may follow a number, both of which are >> optional, but if the units are given the scale factor must also be given. > > So you can have 1000mm or 0.001km bu

Re: [Python-ideas] SI scale factors in Python

2016-08-24 Thread Chris Angelico
On Thu, Aug 25, 2016 at 2:28 PM, Ken Kundert wrote: > I propose that support for SI scale factors be added to Python. This would > be very helpful for any program that heavily uses real numbers, such as those > involved with scientific and engineering computation. There would be two > primary

Re: [Python-ideas] Adding optional parameter to shutil.rmtree to not delete root.

2016-08-24 Thread eryk sun
On Thu, Aug 25, 2016 at 2:29 AM, Nick Jacobson via Python-ideas wrote: > I've been finding that a common scenario is where I want to remove > everything in a directory, but leave the (empty) root directory behind, not > removing it. > > So for example, if I have a directory C:\foo and it contains

Re: [Python-ideas] SI scale factors in Python

2016-08-24 Thread Greg Ewing
Ian Kelly wrote: Should 1m be interpreted as 1 meter or 0.001 (unitless)? I've never seen anyone use a scale factor prefix on its own with a dimensionless number. Sometimes informally the unit is omitted when it can be inferred from context (e.g. "1k" written next to a resistor symbol obviousl

Re: [Python-ideas] SI scale factors in Python

2016-08-24 Thread Greg Ewing
Chris Angelico wrote: If units are retained, what you have is no longer a simple number, but a value with a unit, and is a quite different beast. (For instance, addition would have to cope with unit mismatches (probably by throwing an error), and multiplication would have to combine the units (le

Re: [Python-ideas] SI scale factors in Python

2016-08-24 Thread Chris Angelico
On Thu, Aug 25, 2016 at 3:57 PM, Greg Ewing wrote: > Chris Angelico wrote: >> >> If units are retained, what you have is no longer a simple number, but >> a value with a unit, and is a quite different beast. (For instance, >> addition would have to cope with unit mismatches (probably by throwing >

Re: [Python-ideas] SI scale factors in Python

2016-08-24 Thread Xavier Combelle
On 25/08/2016 06:28, Ken Kundert wrote: > All, > I propose that support for SI scale factors be added to Python. This would > be very helpful for any program that heavily uses real numbers, such as those > involved with scientific and engineering computation. There would be two > primary > c

Re: [Python-ideas] SI scale factors in Python

2016-08-24 Thread Ian Kelly
On Wed, Aug 24, 2016 at 11:57 PM, Greg Ewing wrote: > Chris Angelico wrote: >> >> If units are retained, what you have is no longer a simple number, but >> a value with a unit, and is a quite different beast. (For instance, >> addition would have to cope with unit mismatches (probably by throwing