Why date do not construct from date?

Alexandr N Zamaraev tonal at promsoft.ru
Tue Jun 2 01:25:36 EDT 2009


Simple example:
[code]
Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit 
(Intel)] on win32
 >>> import datetime as dt
 >>> dt.date(2009, 10, 15)
datetime.date(2009, 10, 15)
 >>> d = dt.date(2009, 10, 15)
 >>> dt.date(d)
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
TypeError: function takes exactly 3 arguments (1 given)
 >>>
[/code]
Why int form int, str from str, Decumal from Decumal can construct bat 
date from date not?



More information about the Python-list mailing list