[issue24416] Have date.isocalendar() return a structseq instance

Tim Peters report at bugs.python.org
Sat Sep 7 01:21:03 EDT 2019


Tim Peters <tim at python.org> added the comment:

I favor making this a structseq, primarily based on Paul's attempt to find actual use cases, which showed that named member access would be most useful most often.  I have no intuition for that myself, because while I wrote the original functions here, I've never used them and never will ;-)  But if I ever did, I'd probably want the ISO week number, and would appreciate not having to remember which meaningless index means "week".

Don't care about moving pickles to older versions.

Don't care about the putative speed hit - it's still measured in nanoseconds, so can still create over a million per second.  In apps with a large number of dates, they're typically not _calculated_, but read up from a relatively snail-like database or network connection.  I doubt anyone would notice if `.isocalendar()` got 10x slower.

Note:  I'm unassigning myself, because I have nothing else to say :-)

----------
assignee: tim.peters -> 

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue24416>
_______________________________________


More information about the Python-bugs-list mailing list