[issue2267] datetime.datetime operator methods are not subclass-friendly

2008-03-10 Thread Paul Komkoff

New submission from Paul Komkoff <[EMAIL PROTECTED]>:

The datetime.datetime class overrides some arithmetic operations for it
to be able to add or subtract timedeltas. However, the result of A + B
operation, where A is instance of a subclass of datetime and B is
timedelta instance will be always the instance of base datetime.

This is extremely annoying and requires to override arithmetic operators
and writing a lots of rubbish to replace the datetime base object with
type(self)

--
components: Library (Lib)
messages: 63446
nosy: stingray
severity: normal
status: open
title: datetime.datetime operator methods are not subclass-friendly
type: behavior
versions: Python 2.5

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue2267>
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2267] datetime.datetime operator methods are not subclass-friendly

2008-03-10 Thread Paul Komkoff

Paul Komkoff <[EMAIL PROTECTED]> added the comment:

I just checked the astimezone method - it also does this.

As with timedelta... well, it's not critical for me now but it worth
thinking about :)

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue2267>
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com