Jason Friedman
unread,Aug 18, 2018, 11:44:14 AM8/18/18You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
$ python3
Python 3.6.1 (default, Apr 8 2017, 09:56:20)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import collections, datetime
>>> x = collections.defaultdict(int)
>>> x['something']
0
>>> x = collections.defaultdict(datetime.datetime)
>>> x['something']
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: Required argument 'year' (pos 1) not found
I would like to have a dictionary where the default value is a
datetime.datetime object, preferably something small like January 1, year 1.