| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
- `from None` if the new exception uses, or doesn't need, the previous one
- `from e` if the previous exception is still relevant
|
|
|
| |
Fix the wording in the documentation of `async for` to correctly describe asynchronous iterables. This fix is relevant for version 3.7 onward.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This allows easier Enum construction in unusual cases, such as including dynamic member definitions into a class definition:
# created dynamically
foo_defines = {'FOO_CAT': 'aloof', 'BAR_DOG': 'friendly', 'FOO_HORSE': 'big'}
class Foo(Enum):
vars().update({
k: v
for k, v in foo_defines.items()
if k.startswith('FOO_')
})
def upper(self):
# example method
return self.value.upper()
|
|
|
| |
The default for auto() is to return an integer, which doesn't work for `StrEnum`. The new `_generate_next_value_` for `StrEnum` returns the member name, lower cased.
|
|
|
|
|
|
|
|
|
| |
This is a follow-up to
https://github.com/python/cpython/commit/4662fa9bfe4a849fe87bfb321d8ef0956c89a772.
That original commit expanded guards against misspelling assertions on
mocks. This follow-up updates the documentation and improves the error
message by pointing out the potential cause and solution.
Automerge-Triggered-By: GH:gpshead
|
|
|
|
|
|
|
| |
Export the Py_FrozenMain() function: fix a Python 3.9.0 regression.
Python 3.9 uses -fvisibility=hidden and the function was not exported
explicitly and so not exported.
Add also Py_FrozenMain to the stable ABI on Windows.
|
|
|
| |
private names, such as `_Color__hue` and `_Color__hue_` are now normal attributes, and do not become members nor raise exceptions
|
|
|
|
|
| |
When creating an Enum, type.__new__ calls __init_subclass__, but at that point the members have not been added.
This patch suppresses the initial call, then manually calls the ancestor __init_subclass__ before returning the new Enum class.
|
|
|
|
| |
(GH-23726)
|
|
|
| |
Automerge-Triggered-By: GH:vsajip
|
| |
|
|
|
|
|
|
|
|
|
|
| |
pymain_run_file() no longer encodes the filename: pass the filename
as an object to the new _PyRun_AnyFileObject() function.
Add new private functions:
* _PyRun_AnyFileObject()
* _PyRun_InteractiveLoopObject()
* _Py_FdIsInteractive()
|
|
|
|
| |
Remove the private _Py_fopen() function which is no longer needed.
Use _Py_wfopen() or _Py_fopen_obj() instead.
|
|
|
|
| |
pymain_run_startup() now pass the filename as a Python object to
_PyRun_SimpleFileObject().
|
|
|
|
| |
(GH-21684)
|
| |
|
|
|
|
|
| |
Py_CompileString() is now always declared as a function by
Include/pythonrun.h. It is overriden with a macro in
Include/cpython/pythonrun.h.
|
|
|
| |
PyErr_ProgramText() now calls PyErr_ProgramTextObject().
|
| |
|
| |
|
|
|
|
|
|
|
| |
practices (GH-23226)
- Copy existing xxlimited to xxlimited53 (named for the limited API version it uses)
- Build both modules, both in debug and release
- Test both modules
|
| |
|
|
|
|
| |
Removed PyModule_GetWarningsModule() which is useless due to
the _warnings module was converted to a builtin module in 2.6.
|
|
|
|
|
|
|
|
|
|
| |
Fix encoding name when running a ".pyc" file on Windows:
PyRun_SimpleFileExFlags() now uses the correct encoding to decode the
filename.
* Add pyrun_file() subfunction.
* Add pyrun_simple_file() subfunction.
* PyRun_SimpleFileExFlags() now calls _Py_fopen_obj() rather than
_Py_fopen().
|
| |
|
|\
| |
| |
| | |
Python 3.10.0a3
|
| | |
|
| | |
|
|/
|
|
|
|
| |
The solution in gh#python/cpython#13236 is too strict because it
effectively requires the use of Sphinx >= 2.0. It is not too difficult to
make the same solution more robust so it works with all normal versions
of Sphinx.
|
|
|
|
| |
distutils (GH-22088)
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Remove obsolete workaround that prevented running files with
shortcuts when using new universal2 installers built on macOS 11.
Ignore buggy 2nd run_module_event call.
|
|
|
|
| |
(GH-23653)
|
|
|
| |
It was used to implement now removed asyncio.Task.all_tasks().
|
| |
|
|
|
|
|
|
| |
its __bool__ function (GH23613)
Check if NonCallableMock's spec_arg is not None instead of call its __bool__ function
|
|
|
|
|
|
|
|
|
| |
(GH-23656)
Use `_PyArg_NoKeywords` instead of `_PyArg_NoKwnames` when checking the `kwds` tuple when creating `GenericAlias`. This fixes an interpreter crash when passing in keyword arguments to `GenericAlias`'s constructor.
Needs backport to 3.9.
Automerge-Triggered-By: GH:gvanrossum
|
| |
|
|
|
| |
Do the same for PyTuple_SET_ITEM().
|
|
|
|
|
|
| |
If no explicit macOS SDK was specified, setup.py should check for
Tcl and TK frameworks in /Library/Frameworks; the previous commit
inadvertently broke that test.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Several built-in and standard library types now ensure that their internal result tuples are always tracked by the garbage collector:
- collections.OrderedDict.items
- dict.items
- enumerate
- functools.reduce
- itertools.combinations
- itertools.combinations_with_replacement
- itertools.permutations
- itertools.product
- itertools.zip_longest
- zip
Previously, they could have become untracked by a prior garbage collection.
|
|
|
| |
Raise an ImportWarning when the import system falls back on load_module(). As for implementations of load_module(), raise a DeprecationWarning.
|
| |
|
| |
|
|
|
|
|
| |
range (GH-23633)
This can happen when a file was edited after it was imported.
|
|
|
|
| |
Fix test_doctest.py failures for VxWorks by avoiding exact error message checks. (better for everyone all around)
|
| |
|