So this is simple, why can't I run the following code? I've tried many
variances of this, but simply cannot inherit from datetime or
datetime.dateti me. I get this on line 3.
TypeError: function takes at most 2 arguments (3 given)
*************** *************** **
import datetime
_datetime = datetime.dateti me
class MyDateTime(_dat etime):
"""
Identical to builtin datetime.dateti me, except it accepts
invalid dates and times as input.
"""
_valid = True
def __init__(self, year, month, day, *args, **kw):
try:
_datetime.__ini t__(self, year, month, day, *args, **kw)
except _datetime.Value Error:
_valid = False
self.year = year
self.month = month
self.day = day
self.args = args
self.kw = kw
*************** *************** **
variances of this, but simply cannot inherit from datetime or
datetime.dateti me. I get this on line 3.
TypeError: function takes at most 2 arguments (3 given)
*************** *************** **
import datetime
_datetime = datetime.dateti me
class MyDateTime(_dat etime):
"""
Identical to builtin datetime.dateti me, except it accepts
invalid dates and times as input.
"""
_valid = True
def __init__(self, year, month, day, *args, **kw):
try:
_datetime.__ini t__(self, year, month, day, *args, **kw)
except _datetime.Value Error:
_valid = False
self.year = year
self.month = month
self.day = day
self.args = args
self.kw = kw
*************** *************** **
Comment