Chris Barker - NOAA Federal writes:
> Laura Creighton writes:
> > I merely worry about what happens if people
> > start relying upon the fact that a float annotation 'will handle all
> > the numbers I care about' to the forgotten Decimal users such as
> > myself.
>
> Well, that's what you
I merely worry about what happens if people
> start relying upon the fact that a float annotation 'will handle all
> the numbers I care about' to the forgotten Decimal users such as
> myself.
Well, that's what you get in exchange for "type safety".
Which is exactly why I'm concerned about widesp
Steven D'Aprano writes:
> On Tue, Oct 13, 2015 at 04:37:43PM -0700, Raymond Hettinger wrote:
>
>> We could have (and still could) make the choice to always coerce to
>> decimal (every float is exactly representable in decimal). Further,
>> any decimal float or binary float could be losslessly
On Tue, Oct 13, 2015 at 04:37:43PM -0700, Raymond Hettinger wrote:
> We could have (and still could) make the choice to always coerce to
> decimal (every float is exactly representable in decimal). Further,
> any decimal float or binary float could be losslessly coerced to a
> Fraction, but th
On 14 October 2015 at 09:59, Steven D'Aprano wrote:
> On Tue, Oct 13, 2015 at 11:26:09AM -0400, Random832 wrote:
>> "R. David Murray" writes:
>>
>> > On Tue, 13 Oct 2015 14:59:56 +0300, Stefan Mihaila
>> > wrote:
>> >> Maybe it's just python2 habits, but I assume I'm not the only one
>> >> carel
> On Oct 13, 2015, at 9:16 AM, Random832 wrote:
>
>> ##
>> ## Decimal has all of the methods specified by the Real abc, but it should
>> ## not be registered as a Real because decimals do not interoperate with
>> ## binary floats (i.e. Decimal('3.14') + 2.71828 is undefined).
On Tue, Oct 13, 2015 at 11:26:09AM -0400, Random832 wrote:
> "R. David Murray" writes:
>
> > On Tue, 13 Oct 2015 14:59:56 +0300, Stefan Mihaila
> > wrote:
> >> Maybe it's just python2 habits, but I assume I'm not the only one
> >> carelessly thinking that "iterating over an input a second time w
On 10/13/2015 7:59 AM, Stefan Mihaila wrote:
Could someone clarify for me ...
This list, pydev, short for 'python development', is for discussing
development of future releases of CPython. Your question should have
been directed to python-list, where it would be entirely on topic.
--
Ter
On Tue, 13 Oct 2015 12:08:12 -0400, Random832 wrote:
> "R. David Murray" writes:
> > On Tue, 13 Oct 2015 11:26:09 -0400, Random832
> > wrote:
> >
> > And the answer to the question is: lots of code. I've written some:
> > code that iterates an iterator, breaks that loop on a condition, then
>
On 13.10.2015 17:38, Raymond Hettinger wrote:
Traceback (most recent call last):
File "", line 1, in
Decimal('3.14') + 2.71828
TypeError: unsupported operand type(s) for +: 'decimal.Decimal' and 'float'
Reminds me of 'int' and 'long'. Different but almost the same.
Best,
Sven
On Tue, Oct 13, 2015 at 8:26 AM, Random832 wrote:
> "R. David Murray" writes:
>
>> On Tue, 13 Oct 2015 14:59:56 +0300, Stefan Mihaila
>> wrote:
>>> Maybe it's just python2 habits, but I assume I'm not the only one
>>> carelessly thinking that "iterating over an input a second time will
>>> resul
On Wed, Oct 14, 2015 at 3:49 AM, Random832 wrote:
> My theory is that most circumstances under which this would cause a
> RuntimeError are indicative of a bug in the algorithm consuming the
> iterator (for example, an algorithm that hasn't considered iterators and
> expects to be passed an iterabl
Chris Angelico writes:
> A well-behaved iterator is supposed to continue raising StopIteration
> forever once it's been exhausted.
Yes, and that is *precisely* the behavior that causes the problem under
discussion. My question was what code depends on this.
> Play with that, and see where Runtim
In a message of Tue, 13 Oct 2015 08:38:07 -0700, Raymond Hettinger writes:
>
>
>> On Oct 13, 2015, at 4:21 AM, Laura Creighton wrote:
>>
>> Any chance of adding Decimal to the list of things that are also
>> acceptable for things annotated float?
>
>>From Lib/numbers.py:
>
>## Notes on Decimal
>#
On Wed, Oct 14, 2015 at 3:08 AM, Random832 wrote:
> If you are writing code that tries
> to resume iterating after the iterator has been exhausted, I have to
> ask: why?
A well-behaved iterator is supposed to continue raising StopIteration
forever once it's been exhausted. I don't know how much c
> From Lib/numbers.py:
>
> ## Notes on Decimal
> ##
> ## Decimal has all of the methods specified by the Real abc, but it should
> ## not be registered as a Real because decimals do not interoperate with
> ## binary floats (i.e. Decimal('3.14') + 2.71828 is undefined). But,
> ##
"R. David Murray" writes:
> On Tue, 13 Oct 2015 11:26:09 -0400, Random832 wrote:
>> It does raise the question though of what working code it would actually
>> break to have "exhausted" iterators raise an error if you try to iterate
>> them again rather than silently yield no items.
>
> They do r
On Tue, 13 Oct 2015 11:26:09 -0400, Random832 wrote:
> "R. David Murray" writes:
>
> > On Tue, 13 Oct 2015 14:59:56 +0300, Stefan Mihaila
> > wrote:
> >> Maybe it's just python2 habits, but I assume I'm not the only one
> >> carelessly thinking that "iterating over an input a second time will
On Tue, Oct 13, 2015 at 10:26 AM, Random832 wrote:
> "R. David Murray" writes:
>
>> On Tue, 13 Oct 2015 14:59:56 +0300, Stefan Mihaila
>> wrote:
>>> Maybe it's just python2 habits, but I assume I'm not the only one
>>> carelessly thinking that "iterating over an input a second time will
>>> resu
> On Oct 13, 2015, at 4:21 AM, Laura Creighton wrote:
>
> Any chance of adding Decimal to the list of things that are also
> acceptable for things annotated float?
>From Lib/numbers.py:
## Notes on Decimal
##
## Decimal has all of the methods specified by the Real abc, but it
"R. David Murray" writes:
> On Tue, 13 Oct 2015 14:59:56 +0300, Stefan Mihaila
> wrote:
>> Maybe it's just python2 habits, but I assume I'm not the only one
>> carelessly thinking that "iterating over an input a second time will
>> result in the same thing as the first time (or raise an error)"
On Tue, 13 Oct 2015 14:59:56 +0300, Stefan Mihaila
wrote:
> Maybe it's just python2 habits, but I assume I'm not the only one
> carelessly thinking that "iterating over an input a second time will
> result in the same thing as the first time (or raise an error)".
This is the way iterators have
Hey guys,
Could someone clarify for me why it is a good idea to have map return an
iterator
that is iterable multiple times and acts as an empty iterator in
subsequent iterations?
> r = range(10)
> list(r) == list(r)
True
> a=map(lambda x:x+1, [1,2,3])
> list(a) == list(a)
False
Wouldn't it
Any chance of adding Decimal to the list of things that are also
acceptable for things annotated float?
Laura
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
https://mail.python.org/mail
24 matches
Mail list logo