cpython
cpython copied to clipboard
The Python programming language
```python import warnings import asyncio async def spam(): with warnings.catch_warnings(record=True) as ws: await asyncio.sleep(0.1) w = Warning("12345") warnings.warn(w) assert w in (ww.message for ww in ws) async def ham(): with...
Provide informative error messages in function `struct.pack` when its integral arguments are not in range. * Issue: gh-98248
# Feature or enhancement Currently, on instantiating a type with an undefined abstract property named "name" we get the following error message: ``` TypeError: Can't instantiate abstract class IndexNode with...
# Bug report This crashes. It should not. ``` from unittest.mock import create_autospec class X: @property def myprop(self): raise Exception("some bug") create_autospec(X()) ``` Now you could tell for me to...
# Documentation This passage is problematic: > At runtime, isinstance(x, T) will raise [TypeError](https://docs.python.org/3/library/exceptions.html#TypeError). In general, [isinstance()](https://docs.python.org/3/library/functions.html#isinstance) and [issubclass()](https://docs.python.org/3/library/functions.html#issubclass) should not be used with types. 1. It says "in general",...
# Bug report Multiple files use `tuple()`, `list()` and `dict()`, which can slow down performance.
Since 3.10 `asyncio.get_event_loop()` emits a deprecation warning if used outside of the event loop (see #83710). It is a time to turn a warning into error and make `asyncio.get_event_loop()` an...
# relative delta keyword for assertAlmostEqual and assertNotAlmostEqual #71385 gh-71385: a keyword "rel_delta" is introduced to the functions assertAlmostEqual and assertNotAlmostEqual to allow comparisons based on the relative difference of...
https://docs.python.org/dev/faq/programming.html * Issue: gh-96265
#85299 https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.run_in_executor