10000 bpo-44975: [typing] Support issubclass for ClassVar data members by Fidget-Spinner · Pull Request #27883 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-44975: [typing] Support issubclass for ClassVar data members #27883

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'upstream/main' into issubclass_data_pro…
…tocols
  • Loading branch information
Fidget-Spinner committed Dec 5, 2021
commit f44d3b615cf62dbdf73b2604327fcf644f336e4f
47 changes: 43 additions & 4 deletions Doc/whatsnew/3.11.rst
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,48 @@ typing
(Contributed by Ken Jin in :issue:`44975`).


Removed
=======
* :class:`smtpd.MailmanProxy` is now removed as it is unusable without
an external module, ``mailman``. (Contributed by Dong-hee Na in :issue:`35800`.)
sys
---

* :func:`sys.exc_info` now derives the ``type`` and ``traceback`` fields
from the ``value`` (the exception instance), so when an exception is
modified while it is being handled, the changes are reflected in
the results of subsequent calls to :func:`exc_info`.
(Contributed by Irit Katriel in :issue:`45711`.)


threading
---------

* On Unix, if the ``sem_clockwait()`` function is available in the C library
(glibc 2.30 and newer), the :meth:`threading.Lock.acquire` method now uses
the monotonic clock (:data:`time.CLOCK_MONOTONIC`) for the timeout, rather
than using the system clock (:data:`time.CLOCK_REALTIME`), to not be affected
by system clock changes.
(Contributed by Victor Stinner in :issue:`41710`.)


time
----

* On Unix, :func:`time.sleep` now uses the ``clock_nanosleep()`` or
``nanosleep()`` function, if available, which has a resolution of 1 nanosecond
(10\ :sup:`-9` seconds), rather than using ``select()`` which has a resolution
of 1 microsecond (10\ :sup:`-6` seconds).
(Contributed by Benjamin Szőke and Victor Stinner in :issue:`21302`.)

* On Windows 8.1 and newer, :func:`time.sleep` now uses a waitable timer based
on `high-resolution timers
<https://docs.microsoft.com/en-us/windows-hardware/drivers/kernel/high-resolution-timers>`_
which has a resolution of 100 nanoseconds (10\ :sup:`-7` seconds). Previously,
it had a resolution of 1 millisecond (10\ :sup:`-3` seconds).
(Contributed by Benjamin Szőke, Dong-hee Na, Eryk Sun and Victor Stinner in :issue:`21302` and :issue:`45429`.)


unicodedata
-----------

* The Unicode database has been updated to version 14.0.0. (:issue:`45190`).


Optimizations
Expand Down Expand Up @@ -365,6 +403,7 @@ Deprecated
as deprecated, its docstring is now corrected).
(Contributed by Hugo van Kemenade in :issue:`45837`.)


Removed
=======

Expand Down
10 changes: 10 additions & 0 deletions Lib/test/test_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1612,6 +1612,16 @@ class P(Protocol):
with self.assertRaisesRegex(TypeError, "@runtime_checkable"):
isinstance(1, P)

def test_super_call_init(self):
class P(Protocol):
x: int

class Foo(P):
def __init__(self):
super().__init__()

Foo() # Previously triggered RecursionError

def test_runtime_issubclass_with_classvar_data_members(self):
@runtime_checkable
class P(Protocol):
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.
0