madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://"]
  insteadOf = madduck:

Exclude broken typing-extensions version + fix import (#2460)
authorRichard Si <>
Sun, 29 Aug 2021 21:04:49 +0000 (17:04 -0400)
committerGitHub <>
Sun, 29 Aug 2021 21:04:49 +0000 (17:04 -0400)
re. import, the ipynb code was assuming that typing-extensions would
always be available, but that's not the case! There's an environment
marker on the requirement meaning it won't get installed on 3.10 or
higher. The test suite didn't catch this issue since aiohttp pulls in
typing-extensions unconditionally.

index 6e2721ba19c9fb8727575c8bbf01766778813bd5..576e3c84882d77881093ceb219fee280834d3887 100644 (file)
@@ -14,6 +14,8 @@
 - Parsing support has been added for unparenthesized walruses in set literals, set
   comprehensions, and indices (#2447).
 - Pin `setuptools-scm` build-time dependency version (#2457)
+- Exclude typing-extensions version due to it being broken on Python 3.10
+  (#2460)
 ### _Blackd_
index 215fa6cff61267488383582ce5673acb28d6edb6..929096a2098f97a6de86b2cb09b5e817a0a4ca60 100644 (file)
--- a/
+++ b/
@@ -79,7 +79,10 @@ setup(
         "pathspec>=0.9.0, <1",
         "dataclasses>=0.6; python_version < '3.7'",
-        "typing_extensions>=; python_version < '3.10'",
+        "typing_extensions>=",
+        # is broken on at least Python 3.10,
+        #
+        "typing_extensions!=; python_version >= '3.10'",
index ad93c444efc98a7dfd2c12b54dc4cd834bb08b2f..b18f8629136e2af1713a7f2fa72c4be50ea53935 100644 (file)
@@ -1,15 +1,19 @@
 """Functions to process IPython magics with."""
 from functools import lru_cache
 import dataclasses
 import ast
-from typing import Dict
+from typing import Dict, List, Tuple, Optional
 import secrets
-from typing import List, Tuple
+import sys
 import collections
-from typing import Optional
-from typing_extensions import TypeGuard
+if sys.version_info >= (3, 10):
+    from typing import TypeGuard
+    from typing_extensions import TypeGuard
 from import NothingChanged
 from black.output import out