summaryrefslogtreecommitdiff
path: root/tests/float/array_construct.py
diff options
context:
space:
mode:
authorJeff Epler <jepler@gmail.com>2019-11-26 08:45:07 -0600
committerJeff Epler <jepler@gmail.com>2019-11-26 08:45:44 -0600
commite188ae8b230c464d1deb4cc4a1e853c32d093c4d (patch)
treeb3e1f1b8cff91c8a130f84d7f700d1c8d5de5c69 /tests/float/array_construct.py
parent8f24ea48fbddf19429e02a211bae62c3913e4f9d (diff)
time: struct_time: allow construction like a namedtuple, too
Whenever there is more than one argument, delegate the operation to namedtuple_make_new. This allows other circuitpython-compatible idioms, like with keywords time.struct_time(tm_year=2000, tm_mon=1, tm_mday=1, tm_hour=0, tm_min=0, tm_sec=14, tm_wday=5, tm_yday=5, tm_isdst=-1) with 9 positional arguments, etc. The only vaguely plausible CPython behavior still not permitted in CircuitPython that I found is constructing a timetuple from a length-9 list, a la time.struct_time(list(time.localtime()) Even better, by getting rid of an error message, the build shrinks a tiny bit.
Diffstat (limited to 'tests/float/array_construct.py')
0 files changed, 0 insertions, 0 deletions