Context: python/cpython#31781
Snippets below are unsupported and currently raise an error:
>>> from typing import NamedTuple
...
... class Foo(NamedTuple):
... x: int
...Context: python/cpython#31781
Snippets below are unsupported and currently raise an error:
>>> from typing import NamedTuple
...
... class Foo(NamedTuple):
... x: int
...| import asyncio | |
| import os | |
| async def task_inner(): | |
| with open("/dev/urandom", "rb") as urandom: | |
| feed = await asyncio.to_thread(urandom.read, 128) | |
| print(feed[:16].hex(), "\r", end="") | |
| async def task(): | |
| async with asyncio.TaskGroup() as tg: |
| { | |
| "python.analysis.extraPaths": ["Lib/"], | |
| "C_Cpp.files.exclude": { "PC/pyconfig.h": true, "Apple/iOS/Resources/pyconfig.h": true }, | |
| "C_Cpp.exclusionPolicy": "checkFilesAndFolders", | |
| "editor.formatOnSave": false, | |
| "editor.codeActionsOnSave": {"source.fixAll": "never", "source.unusedImports": "never", "source.organizeImports.ruff": "never"} | |
| } |
| # from bulmenisaurus on Python Discord | |
| # this prints hello | |
| print( | |
| "" | |
| .encode("utf_8_sig") | |
| .decode("mac_croatian") | |
| .encode("037") | |
| .decode("maclatin2") |
| #!/usr/bin/env bash | |
| set -Eeuxo pipefail | |
| rg $1 -no --no-heading -r '' | sed 's/:$//' | xargs -l echo break > $2.gdb |
| from collections.abc import Iterator, Sequence | |
| from datetime import date, timedelta | |
| from functools import partial | |
| from itertools import batched | |
| work_time = timedelta(hours=7, minutes=15) | |
| year = 2025 | |
| ( |
| import ast | |
| import sys | |
| import textwrap | |
| from pathlib import Path | |
| from typing import NamedTuple | |
| from typeshed_client import get_search_context, get_stub_ast | |
| try: | |
| typeshed_root = Path(sys.argv[1]) |