Content-Length: 287876 | pFad | https://github.com/python/cpython/issues/112451

BF C-extension `datetime.timezone` is not acceptable as a base class; pure-Python version is · Issue #112451 · python/cpython · GitHub
Skip to content

C-extension datetime.timezone is not acceptable as a base class; pure-Python version is #112451

@mattip

Description

@mattip

Bug report

Bug description:

Datetime has two modes. There is divergent behavior between the pure python and the c-extension timezone class, as found in django

>>> import datetime, _pydatetime
>>> class timezone(_pydatetime.timezone): pass  # Works fine...
... 
>>> class timezone(datetime.timezone): pass  # Fails to subclass...
... 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: type 'datetime.timezone' is not an acceptable base type

CPython versions tested on:

3.12

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    extension-modulesC modules in the Modules dirtype-bugAn unexpected behavior, bug, or error

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: https://github.com/python/cpython/issues/112451

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy