In <[EMAIL PROTECTED]>, Christophe wrote:
> Well, the main reason for such change is and will always be to catch
> bugs. The fact is, using duct typing is something very common with the
> Python language.
Duct typing? I guess you mean duct taping, or duck taping [1] or maybe
duck typing. :-)
[EMAIL PROTECTED] wrote:
> Consider this example:
>
X = range(5)
Y = iter(X)
Z = iter(Y)
>
> As you can see, X is a container, and Y is an iterator.
> They are simliar in that "iter" works on them both.
>
> Cristoph claims that this causes confusion.
> Why? Because "iter" doesn't
Consider this example:
>>> X = range(5)
>>> Y = iter(X)
>>> Z = iter(Y)
As you can see, X is a container, and Y is an iterator.
They are simliar in that "iter" works on them both.
Cristoph claims that this causes confusion.
Why? Because "iter" doesn't have the same meaning for both of them.
For
Terry Reedy a écrit :
> "Christophe" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>
>>Instead of saying that all works as intended could you be a little
>>helpful and tell me why it was intended in such an obviously broken way
>>instead ?
>
>
> I answered both your explicit and
"Christophe" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>Instead of saying that all works as intended could you be a little
>helpful and tell me why it was intended in such an obviously broken way
>instead ?
I answered both your explicit and implied questions in good faith. But
Christophe wrote:
> Yes, I know perfectly well that the bugs were my fault. But this doesn't
> prevent me from asking for a feature that will have ( in my opinion ) a
> negligible effect of current valid code and will help all of us catch
> errors earlier.
... and apparently choosing to ask in
Fredrik Lundh a écrit :
> Christophe wrote:
>
>> Maybe I've used more iterables than most of you. Maybe I've been doing
>> that wrong.
>
>
> your problem is that you're confusing iterables with sequences. they're
> two different things.
Yes, I know perfectly well that the bugs were my fault.
Christophe wrote:
> Maybe I've used more iterables than most of you. Maybe I've been doing
> that wrong.
your problem is that you're confusing iterables with sequences. they're
two different things.
--
http://mail.python.org/mailman/listinfo/python-list
Roel Schroeven a écrit :
> Fredrik Lundh schreef:
>> so what is a valid answer?
>
>
> I think he wants to know why the spec has been written that way.
>
> The rationale mentions exhausted iterators:
>
> "Once a particular iterator object has raised StopIteration, will
> it also raise StopIterat
Diez B. Roggisch a écrit :
> Christophe wrote:
>
>
>>Fredrik Lundh a écrit :
>>
>>>Christophe wrote:
>>>
>>>
Because I'm still waiting for a valid answer to my question. The
answer "Because it has been coded like that" or is not a valid one.
>>>
>>>
>>>it's been coded like that because th
Fredrik Lundh schreef:
> Christophe wrote:
>
Because I'm still waiting for a valid answer to my question.
The answer "Because it has been coded like that" or is not a
valid one.
>>> it's been coded like that because that's what the specification
>>> says:
>>>
>>> http://www.python.
Fredrik Lundh a écrit :
> Christophe wrote:
>
Because I'm still waiting for a valid answer to my question. The
answer "Because it has been coded like that" or is not a valid one.
>>>
>>>
>>> it's been coded like that because that's what the specification says:
>>>
>>> http://www.pyt
Christophe wrote:
> Fredrik Lundh a écrit :
>> Christophe wrote:
>>
>>> Because I'm still waiting for a valid answer to my question. The
>>> answer "Because it has been coded like that" or is not a valid one.
>>
>>
>> it's been coded like that because that's what the specification says:
>>
>>
Christophe wrote:
>>> Because I'm still waiting for a valid answer to my question. The
>>> answer "Because it has been coded like that" or is not a valid one.
>>
>> it's been coded like that because that's what the specification says:
>>
>> http://www.python.org/dev/peps/pep-0234/
>
> I didn
Fredrik Lundh a écrit :
> Christophe wrote:
>
>> Because I'm still waiting for a valid answer to my question. The
>> answer "Because it has been coded like that" or is not a valid one.
>
>
> it's been coded like that because that's what the specification says:
>
> http://www.python.org/dev
Christophe wrote:
> Because I'm still waiting for a valid answer to my question. The answer
> "Because it has been coded like that" or is not a valid one.
it's been coded like that because that's what the specification says:
http://www.python.org/dev/peps/pep-0234/
--
http://mail.pytho
looping a écrit :
> Christophe wrote:
>
>>Ok, call me stupid if you want but I know perfectly well the "solution"
>>to that problem ! Come on, I was showing example code of an horrible
>>gotcha on using iterators.
>>
>
>
> OK, your are stupid ;-)
> Why asking questions when you don't want to lis
Christophe wrote:
> Ok, call me stupid if you want but I know perfectly well the "solution"
> to that problem ! Come on, I was showing example code of an horrible
> gotcha on using iterators.
>
OK, your are stupid ;-)
Why asking questions when you don't want to listen answers ?
>
>
> Instead of
Terry Reedy a écrit :
> "Christophe" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>
>>Is there a good reason why when you try to take an element from an
>>already exausted iterator, it throws StopIteration instead of some other
>>exception ?
>
>
> Yes.
> .
> .
> To distinguish
Christophe wrote:
> Is there a good reason why when you try to take an element from an
> already exausted iterator, it throws StopIteration instead of some other
> exception ? I've lost quite some times already because I was using a lot
> of iterators and I forgot that that specific function param
"Christophe" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Is there a good reason why when you try to take an element from an
> already exausted iterator, it throws StopIteration instead of some other
> exception ?
Yes.
.
.
To distinguish the control message "I am done yielding v
Is there a good reason why when you try to take an element from an
already exausted iterator, it throws StopIteration instead of some other
exception ? I've lost quite some times already because I was using a lot
of iterators and I forgot that that specific function parameter was one.
Exemple :
22 matches
Mail list logo