Message378933
Other problem is that the repr looks like an evaluable expression, but evaluating it will always produce error.
>>> st = os.stat('/dev/null')
>>> st
os.stat_result(st_mode=8630, st_ino=6, st_dev=6, st_nlink=1, st_uid=0, st_gid=0, st_size=0, st_atime=1602523313, st_mtime=1602523313, st_ctime=1602523313)
>>> os.stat_result(st_mode=8630, st_ino=6, st_dev=6, st_nlink=1, st_uid=0, st_gid=0, st_size=0, st_atime=1602523313, st_mtime=1602523313, st_ctime=1602523313)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: structseq() takes at most 2 keyword arguments (10 given)
os.stat_result() accepts only two arguments: a tuple for indexable elements and a dict for non-indexable elements.
>>> os.stat_result((8630, 6, 6, 1, 0, 0, 0, 1602523313, 1602523313, 1602523313), {'st_atime': 1602523313.282834, 'st_mtime': 1602523313.282834, 'st_ctime': 1602523313.282834, 'st_atime_ns': 1602523313282834115, 'st_mtime_ns': 1602523313282834115, 'st_ctime_ns': 1602523313282834115, 'st_blksize': 4096, 'st_blocks': 0, 'st_rdev': 259})
os.stat_result(st_mode=8630, st_ino=6, st_dev=6, st_nlink=1, st_uid=0, st_gid=0, st_size=0, st_atime=1602523313, st_mtime=1602523313, st_ctime=1602523313)
But such form looks not very readable, because it lacks names for indexable elements.
To solve this we can use an angular form in the repr:
<os.stat_result ...> |
|
Date |
User |
Action |
Args |
2020-10-19 08:47:33 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, rhettinger, pitrou, ezio.melotti, eric.araujo, Arfrever, eric.snow, lilydjwg, berker.peksag, dlam, pconnell, sunfinite, mblahay |
2020-10-19 08:47:32 | serhiy.storchaka | set | messageid: <1603097252.93.0.637610286666.issue11698@roundup.psfhosted.org> |
2020-10-19 08:47:32 | serhiy.storchaka | link | issue11698 messages |
2020-10-19 08:47:32 | serhiy.storchaka | create | |
|