This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author nassrat
Recipients mark.dickinson, nassrat, pitrou
Date 2008-12-01.12:17:23
SpamBayes Score 4.3678305e-08
Marked as misclassified No
Message-id <2238dbfb0812010417m47fdf9e9gc3a53e7d52e877e0@mail.gmail.com>
In-reply-to <1228132850.1350.7.camel@localhost>
Content
On Mon, Dec 1, 2008 at 8:01 AM, Antoine Pitrou <report@bugs.python.org> wrote:
>
> Antoine Pitrou <pitrou@free.fr> added the comment:
>
> Le lundi 01 décembre 2008 à 11:15 +0000, Mark Dickinson a écrit :
>> My initial reaction to this was negative, but I'm struggling to think of
>> situations where it would be bad.
>
> Consider someone who writes:
>
> z = y / x
> return my_list[z]
>
> In all his tests, x is a divisor of y and therefore z is an integer, the
> code runs ok.
> Suddenly in an use case, x is not a divisor of y, z is therefore a
> float, and the "return" line raises a TypeError.

That brings me to another point which will make you guys think i'm
crazy and close this thread immediately :-). I actually tried that
recently (that being using a float as an index), actually used it as a
slice. I would think that should work, it should round the float
usually, and if used in a slice, if it is an end it should round up,
if it is a start round down, for 0.5?

Maybe I should write my first PEP and watch it thrown out :-)
History
Date User Action Args
2008-12-01 12:17:24nassratsetrecipients: + nassrat, mark.dickinson, pitrou
2008-12-01 12:17:23nassratlinkissue4479 messages
2008-12-01 12:17:23nassratcreate