How to subclass datetime?

Martin v. Löwis martin at v.loewis.de
Sun Apr 13 12:16:15 EDT 2003


janeaustine50 at hotmail.com (Jane Austine) writes:

> I'm interested in the new datetime module and I want to subclass
> date/datetime class to modify the behaviour. However, simply
> inheritting the classes(like "class mydate(date):" ) didn't work.

What do you mean "didn't work"? It works fine for me:

>>> import datetime
>>> class Tag(datetime.date):pass
...

Regards,
Martin




More information about the Python-list mailing list