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 jess.austin
Recipients amaury.forgeotdarc, belopolsky, fredrikj, jess.austin, jribbens, mark.dickinson, tleeuwenburg@gmail.com, vstinner, webograph
Date 2009-03-25.00:04:23
SpamBayes Score 2.5202063e-14
Marked as misclassified No
Message-id <1237939464.57.0.053130167769.issue2706@psf.upfronthosting.co.za>
In-reply-to
Content
A comment on the two most recent patches...  For both of these, we can
do the following:

>>> from datetime import timedelta
>>> td = timedelta(12)
>>> td
datetime.timedelta(12)
>>> td //= 3
>>> td
datetime.timedelta(4)
>>> td //= timedelta(2)
>>> td
2          # CHANGED VARIABLE TYPE!

I think the last operation will trap unsuspecting programmers, and
provide no benefit for the savvy.  There really is no reason to allow an
in-place operation like this to change the type of the variable so
drastically.  (That is, I realize a similar thing could happen with ints
and floats, but it seems worse with timedeltas and ints.)  I feel the
last operation should raise a TypeError, even though it would be quite
valid for a non-in-place operation.
History
Date User Action Args
2009-03-25 00:04:25jess.austinsetrecipients: + jess.austin, jribbens, amaury.forgeotdarc, mark.dickinson, belopolsky, vstinner, fredrikj, webograph, tleeuwenburg@gmail.com
2009-03-25 00:04:24jess.austinsetmessageid: <1237939464.57.0.053130167769.issue2706@psf.upfronthosting.co.za>
2009-03-25 00:04:23jess.austinlinkissue2706 messages
2009-03-25 00:04:23jess.austincreate