So, for a long time now, I have been using code like the following in Python for version tracking:
...
import datetime
...
"""
Version tracking
"""
__version__ = 4.0
__dateV__ = datetime.date(2015, 5, 7)
...
Now, out of the blue, I get an error saying "TypeError: descriptor 'date' requires a 'datetime.datetime' object but received a 'int'"
This has never happened before, and the documentation for the datetime module says that a "date" object should be initialized with year, month, and day arguments, which are all INTEGERS.
I have confirmed that I am using Python version 2.7.
Has anyone else seen this error? This is literally at the top of my code (right after all of the imports.) Please help.
from datetime import datetime.import datetime as dt dt.datetime.date(2014,1,1)typing.Optionalortyping.Union? the issue is the bad import becauseimport datetimeresults indatetimebeing a module, whereasfrom datetime import datetimeresults indatetimebeing type - andtypingonly accepts ŧypes :)