sub-classing the types in the builtin module datetime

Jay Loden python at jayloden.com
Wed Aug 15 13:55:11 EDT 2007


Colin J. Williams wrote:
> I wish to sub-class (if that's the right word) datetime and to use a 
> different signature for the constructor.
> 
> The second part has gone smoothly, but it is difficult to access the 
> type's methods from the sub-class instance.
> 
> I'm beginning to wonder whether it might might be simpler to write my 
> own Date class.
> 
> Does anyone have any comments please?
> 
> Colin W.

I think it would be most effective if you can post the code you're using that illustrates the issue, and what you're trying to do so that the list members can analyze the actual problem. Tracebacks etc are also welcome if applicable.

-Jay



More information about the Python-list mailing list