[issue24416] Return a namedtuple from date.isocalendar()

Dong-hee Na report at bugs.python.org
Sun Sep 1 10:47:09 EDT 2019


Dong-hee Na <donghee.na92 at gmail.com> added the comment:

@p-ganssle @taleinat

I agree that there are penalties of this patch what you said.
But I'm wondering how the `fromisocalendar` API relates to this patch.
Rather, wouldn't this patch contribute to improving the usability of the `fromisocalendar` API?
I would appreciate it if you would generously understand that my background knowledge of this module is less than yours.

AS-IS:

>>> year, week, weekday = a.isocalendar()
>>> datetime.date.fromisocalendar(year, week, weekday)
datetime.date(2019, 9, 1)

TO-BE:
>>> b = a.isocalendar()
>>> datetime.date.fromisocalendar(b.year, b.week, b.weekday)
datetime.date(2019, 9, 1)

----------

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


More information about the Python-bugs-list mailing list