[New-bugs-announce] [issue41025] C implementation of ZoneInfo cannot be subclassed
Paul Ganssle
report at bugs.python.org
Thu Jun 18 10:26:51 EDT 2020
New submission from Paul Ganssle <p.ganssle at gmail.com>:
In the C implementation of zoneinfo.ZoneInfo, __init_subclass__ is not declared as a classmethod, which prevents it from being subclassed. This was not noticed because the tests for ZoneInfo subclasses in C are actually testing zoneinfo.ZoneInfo, not a subclass, due to a mistake in the inheritance tree: https://github.com/python/cpython/blob/8f192d12af82c4dc40730bf59814f6a68f68f950/Lib/test/test_zoneinfo/test_zoneinfo.py#L465-L487
Originally reported on the backport by Sébastien Eustace: https://github.com/pganssle/zoneinfo/issues/82
The fix in the backport is here: https://github.com/pganssle/zoneinfo/pull/83
----------
assignee: p-ganssle
components: Library (Lib)
messages: 371817
nosy: p-ganssle
priority: high
severity: normal
stage: needs patch
status: open
title: C implementation of ZoneInfo cannot be subclassed
versions: Python 3.10, Python 3.9
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41025>
_______________________________________
More information about the New-bugs-announce
mailing list