Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Revert 19108 remove c element tree#20116

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Show file tree
Hide file tree
Changes from114 commits
Commits
Show all changes
118 commits
Select commitHold shift + click to select a range
8dc3917
Update docs.
serhiy-storchakaMay 5, 2020
4e01946
bpo-40513: Per-interpreter signals pending (GH-19924)
vstinnerMay 5, 2020
0b1e330
bpo-40513: Per-interpreter gil_drop_request (GH-19927)
vstinnerMay 5, 2020
c5fa364
bpo-40514: Add --with-experimental-isolated-subinterpreters (GH-19926)
vstinnerMay 5, 2020
627f701
bpo-32117: Updated Simpsons names in docs (GH-19737)
kingbuzzmanMay 5, 2020
4e30ed3
bpo-40513: Per-interpreter recursion_limit (GH-19929)
vstinnerMay 5, 2020
b0be6b3
bpo-29587: _PyErr_ChainExceptions() checks exception (GH-19902)
vstinnerMay 5, 2020
6351d9e
bpo-40520: Remove redundant comment in pydebug.h (GH-19931)
shihai1991May 5, 2020
299b8c6
Revert "bpo-40513: Per-interpreter signals pending (GH-19924)" (GH-19…
vstinnerMay 5, 2020
607b102
bpo-40521: Disable Unicode caches in isolated subinterpreters (GH-19933)
vstinnerMay 5, 2020
ac4bf42
bpo-40458: Increase reserved stack space to prevent overflow crash on…
zoobaMay 5, 2020
b4b5386
bpo-40521: Disable free lists in subinterpreters (GH-19937)
vstinnerMay 5, 2020
e838a93
bpo-40522: _PyThreadState_Swap() sets autoTSSkey (GH-19939)
vstinnerMay 5, 2020
0dd5e7a
bpo-40513: new_interpreter() init GIL earlier (GH-19942)
vstinnerMay 5, 2020
7be4e35
bpo-40513: Per-interpreter GIL (GH-19943)
vstinnerMay 5, 2020
fb2c7c4
bpo-40513: _xxsubinterpreters.run_string() releases the GIL (GH-19944)
vstinnerMay 5, 2020
c21c512
bpo-40355: Improve error messages in ast.literal_eval with malformed …
curtisbucherMay 5, 2020
1253c3e
bpo-40504: Allow weakrefs to lru_cache objects (GH-19938)
sweeneydeMay 5, 2020
96074de
bpo-40523: Add pass-throughs for hash() and reversed() to weakref.pro…
pablogsalMay 5, 2020
b9c46a2
bpo-40480 "fnmatch" exponential execution time (GH-19908)
tim-oneMay 6, 2020
d60040b
bpo-40517: Implement syntax highlighting support for ASDL (#19928)
isidenticalMay 6, 2020
eff870b
Revert "bpo-40517: Implement syntax highlighting support for ASDL (#1…
rhettingerMay 6, 2020
2668a9a
bpo-40527: Fix command line argument parsing (GH-19955)
vstinnerMay 6, 2020
091951a
bpo-40528: Improve and clear several aspects of the ASDL definition c…
isidenticalMay 6, 2020
89fc4a3
bpo-40521: Disable method cache in subinterpreters (GH-19960)
vstinnerMay 6, 2020
d8135e9
bpo-40533: Disable GC in subinterpreters (GH-19961)
vstinnerMay 6, 2020
b7aa23d
bpo-40521: Disable list free list in subinterpreters (GH-19959)
vstinnerMay 6, 2020
999ec9a
bpo-40334: Add type to the assignment rule in the grammar file (GH-19…
lysnikolaouMay 6, 2020
441416c
Fix typo in sqlite3 documentation (GH-19965)
naglisMay 6, 2020
99db2a1
bpo-40334: Allow trailing comma in parenthesised context managers (GH…
pablogsalMay 6, 2020
470aac4
bpo-40334: Generate comments in the parser code to improve debugging …
pablogsalMay 6, 2020
c1c7d8e
bpo-40397: Refactor typing._GenericAlias (GH-19719)
serhiy-storchakaMay 7, 2020
3466922
bpo-1635741: Port errno module to multiphase initialization (GH-19923)
corona10May 7, 2020
2f37c35
bpo-40334: Fix error location upon parsing an invalid string literal …
lysnikolaouMay 7, 2020
4638c64
bpo-40334: Error message for invalid default args in function call (G…
lysnikolaouMay 7, 2020
e1becf4
bpo-38787: C API for module state access from extension methods (PEP …
encukouMay 7, 2020
8963a7f
bpo-40545: Export _PyErr_GetTopmostException() function (GH-19978)
vstinnerMay 7, 2020
a1d9e0a
bpo-32604: [_xxsubinterpreters] Propagate exceptions. (GH-19768)
ericsnowcurrentlyMay 7, 2020
c068b53
bpo-38787: Update structures.rst docs (PEP 573) (GH-19980)
shihai1991May 7, 2020
4e36376
bpo-40548: Always run GitHub action, even on doc PRs (GH-19981)
vstinnerMay 7, 2020
b7a78ca
bpo-40517: Implement syntax highlighting support for ASDL (GH-19967)
isidenticalMay 7, 2020
db9163c
bpo-40555: Check for p->error_indicator in loop rules after the main …
pablogsalMay 8, 2020
02fa0ea
bpo-40273: Reversible mappingproxy (FH-19513)
ZackerySpytzMay 8, 2020
d2c349b
bpo-40559: Add Py_DECREF to _asynciomodule.c:task_step_impl() (GH-19990)
cjerdonekMay 8, 2020
2effef7
Make the first dataclass example more useful (GH-19994)
nedbatMay 8, 2020
81a5fc3
bpo-40541: Add optional *counts* parameter to random.sample() (GH-19970)
rhettingerMay 8, 2020
d10091a
bpo-40502: Initialize n->n_col_offset (GH-19988)
nanjekyejoannahMay 8, 2020
7f7e706
bpo-39791: Add files() to importlib.resources (GH-19722)
jaracoMay 8, 2020
77c6146
bpo-40566: Apply PEP 573 to abc module (GH-20005)
corona10May 9, 2020
2c3d508
bpo-40570: Improve compatibility of uname_result with late-bound .pla…
jaracoMay 9, 2020
ac7a92c
bpo-40334: Avoid collisions between parser variables and grammar vari…
pablogsalMay 10, 2020
85bdec1
Add link to Enum class (GH-19884)
andresdelfinoMay 10, 2020
fcb2856
bpo-40397: Remove __args__ and __parameters__ from _SpecialGenericAli…
serhiy-storchakaMay 10, 2020
1c2fa78
bpo-40549: Convert posixmodule.c to multiphase init (GH-19982)
vstinnerMay 10, 2020
86a93fd
bpo-37986: Improve perfomance of PyLong_FromDouble() (GH-15611)
sir-sigurdMay 10, 2020
0122d48
bpo-40397: Fix subscription of nested generic alias without parameter…
serhiy-storchakaMay 10, 2020
2fbc57a
bpo-40257: Tweak docstrings for special generic aliases. (GH-20022)
serhiy-storchakaMay 10, 2020
2cc9b84
Improve code clarity for the set lookup logic (GH-20028)
rhettingerMay 10, 2020
5b956ca
bpo-40585: Normalize errors messages in codeop when comparing them (G…
pablogsalMay 11, 2020
6067d4b
bpo-40575: Avoid unnecessary overhead in _PyDict_GetItemIdWithError()…
scoderMay 11, 2020
d5d9a71
bpo-36346: array: Don't use deprecated APIs (GH-19653)
methaneMay 11, 2020
ef7973a
bpo-40561: Add docstrings for webbrowser open functions (GH-19999)
bsolomon1124May 11, 2020
86d6944
bpo-40584: Update PyType_FromModuleAndSpec() to process tp_vectorcall…
shihai1991May 11, 2020
27c0d9b
bpo-40334: produce specialized errors for invalid del targets (GH-19911)
hauntsaninjaMay 11, 2020
4804b5b
bpo-39465: Don't access directly _Py_Identifier members (GH-20043)
vstinnerMay 11, 2020
21cdb71
bpo-40571: Make lru_cache(maxsize=None) more discoverable (GH-20019)
rhettingerMay 12, 2020
b617993
bpo-40602: Rename hashtable.h to pycore_hashtable.h (GH-20044)
vstinnerMay 12, 2020
d0919f0
bpo-40602: _Py_hashtable_new() uses PyMem_Malloc() (GH-20046)
vstinnerMay 12, 2020
b1b4c79
bpo-40480: restore ability to join fnmatch.translate() results (GH-20…
tim-oneMay 12, 2020
f3a5b7a
bpo-39481: remove generic classes from ipaddress/mmap (GH-20045)
isidenticalMay 12, 2020
74ea6b5
bpo-40593: Improve syntax errors for invalid characters in source cod…
serhiy-storchakaMay 12, 2020
7c6e970
bpo-40602: Optimize _Py_hashtable for pointer keys (GH-20051)
vstinnerMay 12, 2020
5650e76
bpo-40596: Fix str.isidentifier() for non-canonicalized strings conta…
serhiy-storchakaMay 12, 2020
4c9ea09
bpo-38787: Add PyCFunction_CheckExact() macro for exact type checks (…
scoderMay 12, 2020
f453221
bpo-40602: Add _Py_HashPointerRaw() function (GH-20056)
vstinnerMay 12, 2020
d6b727e
bpo-40501: Replace ctypes code in uuid with native module (GH-19948)
zoobaMay 12, 2020
3d54211
Fix Wikipedia link (GH-20031)
guoguo12May 12, 2020
9e2ca17
bpo-40609: Rewrite how _tracemalloc handles domains (GH-20059)
vstinnerMay 12, 2020
f9b3b58
bpo-40609: Remove _Py_hashtable_t.key_size (GH-20060)
vstinnerMay 13, 2020
2d0a3d6
bpo-40609: Add destroy functions to _Py_hashtable (GH-20062)
vstinnerMay 13, 2020
d95bd42
bpo-40609: _tracemalloc allocates traces (GH-20064)
vstinnerMay 13, 2020
5b0a303
bpo-40609: _Py_hashtable_t values become void* (GH-20065)
vstinnerMay 13, 2020
42bae3a
bpo-40602: Optimize _Py_hashtable_get_ptr() (GH-20066)
vstinnerMay 13, 2020
b809717
bpo-40331: Increase test coverage for the statistics module (GH-19608)
tzabalMay 13, 2020
fa0a66e
bpo-40613: Remove compiler warning from _xxsubinterpretersmodule (GH-…
corona10May 13, 2020
de92769
bpo-34790: add version of removal of explicit passing of coros to `as…
JackenmenMay 13, 2020
a15c9b3
bpo-40334: Always show the caret on SyntaxErrors (GH-20050)
lysnikolaouMay 13, 2020
97e1568
bpo-38787: Fix Argument Clinic defining_class_converter (GH-20074)
vstinnerMay 13, 2020
d72ea60
issue-25872: Fix KeyError using linecache from multiple threads (GH-1…
mgraczykMay 13, 2020
d6fb53f
bpo-39465: Remove _PyUnicode_ClearStaticStrings() from C API (GH-20078)
vstinnerMay 13, 2020
75cd8e4
bpo-29587: Make gen.throw() chain exceptions with yield from (GH-19858)
cjerdonekMay 13, 2020
3d17c04
bpo-40521: Add PyInterpreterState.unicode (GH-20081)
vstinnerMay 13, 2020
6f2f475
bpo-40597: email: Use CTE if lines are longer than max_line_length co…
ivylMay 14, 2020
7443d42
bpo-40275: Import locale module lazily in gettext (GH-19905)
shihai1991May 14, 2020
e77d428
bpo-40495: compileall option to hardlink duplicate pyc files (GH-19901)
frenzymadnessMay 14, 2020
97f33c3
bpo-40549: posixmodule.c uses defining_class (GH-20075)
vstinnerMay 14, 2020
f2c3b68
Revert "bpo-32604: [_xxsubinterpreters] Propagate exceptions. (GH-197…
vstinnerMay 14, 2020
a482dc5
bpo-40602: Write unit tests for _Py_hashtable_t (GH-20091)
vstinnerMay 14, 2020
bcc3036
bpo-40619: Correctly handle error lines in programs without file mode…
pablogsalMay 14, 2020
ce21cfc
bpo-40618: Disallow invalid targets in augassign and except clauses (…
lysnikolaouMay 14, 2020
d2dc827
bpo-40602: _Py_hashtable_set() reports rehash failure (GH-20077)
vstinnerMay 14, 2020
75d7257
bpo-40548: GitHub Action workflow: skip jobs on doc only PRs (GH-19983)
FFY00May 14, 2020
edf2643
bpo-40460: Fix typo in idlelib/zzdummy.py (GH-20093)
vstinnerMay 14, 2020
4b972fa
bpo-40462: Fix typo in test_json (GH-20094)
vstinnerMay 14, 2020
7ba1f75
bpo-38872: Document exec symbol for codeop.compile_command (GH-20047)
nanjekyejoannahMay 15, 2020
16ab070
bpo-40334: Correctly identify invalid target in assignment errors (GH…
pablogsalMay 15, 2020
6a78589
bpo-40548: github actions: pass the changes check on no source change…
FFY00May 15, 2020
1aa8767
Update code comment re: location of struct _is. (GH-20067)
cjerdonekMay 15, 2020
15bc9ab
bpo-40612: Fix SyntaxError edge cases in traceback formatting (GH-20072)
gvanrossumMay 15, 2020
4a12d12
Fix typo in code comment in main_loop label. (GH-20068)
cjerdonekMay 15, 2020
003708b
Trivial typo fix in _tkinter.c (GH-19622)
AndrewGYorkMay 15, 2020
6e57237
bpo-40055: test_distutils leaves warnings filters unchanged (GH-20095)
vstinnerMay 15, 2020
16d4e6f
bpo-40479: Fix hashlib issue with OpenSSL 3.0.0 (GH-20107)
tiranMay 15, 2020
62d618c
bpo-40479: Test with latest OpenSSL versions (GH-20108)
tiranMay 15, 2020
60e8085
Merge branch 'revert-19108-remove-cElementTree' of https://github.com…
serhiy-storchakaMay 15, 2020
d577e9b
Merge branch 'master' into revert-19108-remove-cElementTree
serhiy-storchakaMay 15, 2020
8d39d0a
Update NEWS.
serhiy-storchakaMay 15, 2020
55e413a
Merge branch 'revert-19108-remove-cElementTree' of https://github.com…
serhiy-storchakaMay 15, 2020
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
37 changes: 27 additions & 10 deletions.github/workflows/build.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,42 @@
name: Tests

# bpo-40548: "paths-ignore" is not used to skip documentation-only PRs, because
# it prevents to mark a job as mandatory. A PR cannot be merged if a job is
# mandatory but not scheduled because of "paths-ignore".
on:
push:
branches:
- master
- 3.8
- 3.7
paths-ignore:
- 'Doc/**'
- 'Misc/**'
- '**/*.md'
- '**/*.rst'
pull_request:
branches:
- master
- 3.8
- 3.7
paths-ignore:
- 'Doc/**'
- 'Misc/**'
- '**/*.md'
- '**/*.rst'

jobs:
check_source:
name: 'Check for source changes'
runs-on: ubuntu-latest
outputs:
run_tests: ${{ steps.check.outputs.run_tests }}
steps:
- uses: actions/checkout@v2
- name: Check for source changes
id: check
run: |
if [ -z "GITHUB_BASE_REF" ]; then
echo '::set-output name=run_tests::true'
else
git fetch origin $GITHUB_BASE_REF --depth=1
git diff --name-only origin/$GITHUB_BASE_REF... | grep -qvE '(\.rst$|^Doc|^Misc)' && echo '::set-output name=run_tests::true' || true
fi
build_win32:
name: 'Windows (x86)'
runs-on: windows-latest
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
steps:
- uses: actions/checkout@v1
- name: Build CPython
Expand All@@ -38,6 +49,8 @@ jobs:
build_win_amd64:
name: 'Windows (x64)'
runs-on: windows-latest
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
steps:
- uses: actions/checkout@v1
- name: Build CPython
Expand All@@ -50,6 +63,8 @@ jobs:
build_macos:
name: 'macOS'
runs-on: macos-latest
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
steps:
- uses: actions/checkout@v1
- name: Configure CPython
Expand All@@ -64,6 +79,8 @@ jobs:
build_ubuntu:
name: 'Ubuntu'
runs-on: ubuntu-latest
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
env:
OPENSSL_VER: 1.1.1f
steps:
Expand Down
58 changes: 52 additions & 6 deletionsDoc/c-api/structures.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -147,23 +147,56 @@ Implementing functions and methods
value of the function as exposed in Python. The function must return a new
reference.

The function signature is::

PyObject *PyCFunction(PyObject *self,
PyObject *args);

.. c:type:: PyCFunctionWithKeywords

Type of the functions used to implement Python callables in C
with signature :const:`METH_VARARGS | METH_KEYWORDS`.
The function signature is::

PyObject *PyCFunctionWithKeywords(PyObject *self,
PyObject *args,
PyObject *kwargs);


.. c:type:: _PyCFunctionFast

Type of the functions used to implement Python callables in C
with signature :const:`METH_FASTCALL`.
The function signature is::

PyObject *_PyCFunctionFast(PyObject *self,
PyObject *const *args,
Py_ssize_t nargs);

.. c:type:: _PyCFunctionFastWithKeywords

Type of the functions used to implement Python callables in C
with signature :const:`METH_FASTCALL | METH_KEYWORDS`.
The function signature is::

PyObject *_PyCFunctionFastWithKeywords(PyObject *self,
PyObject *const *args,
Py_ssize_t nargs,
PyObject *kwnames);

.. c:type:: PyCMethod

Type of the functions used to implement Python callables in C
with signature :const:`METH_METHOD | METH_FASTCALL | METH_KEYWORDS`.
The function signature is::

PyObject *PyCMethod(PyObject *self,
PyTypeObject *defining_class,
PyObject *const *args,
Py_ssize_t nargs,
PyObject *kwnames)

.. versionadded:: 3.9


.. c:type:: PyMethodDef
Expand DownExpand Up@@ -197,9 +230,7 @@ The :attr:`ml_flags` field is a bitfield which can include the following flags.
The individual flags indicate either a calling convention or a binding
convention.

There are four basic calling conventions for positional arguments
and two of them can be combined with :const:`METH_KEYWORDS` to support
also keyword arguments. So there are a total of 6 calling conventions:
There are these calling conventions:

.. data:: METH_VARARGS

Expand DownExpand Up@@ -250,6 +281,19 @@ also keyword arguments. So there are a total of 6 calling conventions:
.. versionadded:: 3.7


.. data:: METH_METHOD | METH_FASTCALL | METH_KEYWORDS

Extension of :const:`METH_FASTCALL | METH_KEYWORDS` supporting the *defining
class*, that is, the class that contains the method in question.
The defining class might be a superclass of ``Py_TYPE(self)``.

The method needs to be of type :c:type:`PyCMethod`, the same as for
``METH_FASTCALL | METH_KEYWORDS`` with ``defining_class`` argument added after
``self``.

.. versionadded:: 3.9


.. data:: METH_NOARGS

Methods without parameters don't need to check whether arguments are given if
Expand DownExpand Up@@ -380,9 +424,11 @@ Accessing attributes of extension types

Heap allocated types (created using :c:func:`PyType_FromSpec` or similar),
``PyMemberDef`` may contain definitions for the special members
``__dictoffset__`` and ``__weaklistoffset__``, corresponding to
:c:member:`~PyTypeObject.tp_dictoffset` and
:c:member:`~PyTypeObject.tp_weaklistoffset` in type objects.
``__dictoffset__``, ``__weaklistoffset__`` and ``__vectorcalloffset__``,
corresponding to
:c:member:`~PyTypeObject.tp_dictoffset`,
:c:member:`~PyTypeObject.tp_weaklistoffset` and
:c:member:`~PyTypeObject.tp_vectorcall_offset` in type objects.
These must be defined with ``T_PYSSIZET`` and ``READONLY``, for example::

static PyMemberDef spam_type_members[] = {
Expand Down
37 changes: 36 additions & 1 deletionDoc/c-api/type.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -109,14 +109,38 @@ Type Objects

.. versionadded:: 3.4

.. c:function:: PyObject* PyType_GetModule(PyTypeObject *type)

Return the module object associated with the given type when the type was
created using :c:func:`PyType_FromModuleAndSpec`.

If no module is associated with the given type, sets :py:class:`TypeError`
and returns ``NULL``.

.. versionadded:: 3.9

.. c:function:: void* PyType_GetModuleState(PyTypeObject *type)

Return the state of the module object associated with the given type.
This is a shortcut for calling :c:func:`PyModule_GetState()` on the result
of :c:func:`PyType_GetModule`.

If no module is associated with the given type, sets :py:class:`TypeError`
and returns ``NULL``.

If the *type* has an associated module but its state is ``NULL``,
returns ``NULL`` without setting an exception.

.. versionadded:: 3.9


Creating Heap-Allocated Types
.............................

The following functions and structs are used to create
:ref:`heap types <heap-types>`.

.. c:function:: PyObject*PyType_FromSpecWithBases(PyType_Spec *spec, PyObject *bases)
.. c:function:: PyObject*PyType_FromModuleAndSpec(PyObject *module,PyType_Spec *spec, PyObject *bases)

Creates and returns a heap type object from the *spec*
(:const:`Py_TPFLAGS_HEAPTYPE`).
Expand All@@ -127,8 +151,18 @@ The following functions and structs are used to create
If *bases* is ``NULL``, the *Py_tp_base* slot is used instead.
If that also is ``NULL``, the new type derives from :class:`object`.

The *module* must be a module object or ``NULL``.
If not ``NULL``, the module is associated with the new type and can later be
retreived with :c:func:`PyType_GetModule`.

This function calls :c:func:`PyType_Ready` on the new type.

.. versionadded:: 3.9

.. c:function:: PyObject* PyType_FromSpecWithBases(PyType_Spec *spec, PyObject *bases)

Equivalent to ``PyType_FromModuleAndSpec(NULL, spec, bases)``.

.. versionadded:: 3.3

.. c:function:: PyObject* PyType_FromSpec(PyType_Spec *spec)
Expand DownExpand Up@@ -194,6 +228,7 @@ The following functions and structs are used to create
* :c:member:`~PyTypeObject.tp_dictoffset`
(see :ref:`PyMemberDef <pymemberdef-offsets>`)
* :c:member:`~PyTypeObject.tp_vectorcall_offset`
(see :ref:`PyMemberDef <pymemberdef-offsets>`)
* :c:member:`~PyBufferProcs.bf_getbuffer`
* :c:member:`~PyBufferProcs.bf_releasebuffer`

Expand Down
3 changes: 2 additions & 1 deletionDoc/conf.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -14,7 +14,8 @@
# ---------------------

extensions = ['sphinx.ext.coverage', 'sphinx.ext.doctest',
'pyspecific', 'c_annotations', 'escape4chm']
'pyspecific', 'c_annotations', 'escape4chm',
'asdl_highlight']


doctest_global_setup = '''
Expand Down
13 changes: 7 additions & 6 deletionsDoc/library/array.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -22,7 +22,7 @@ defined:
+-----------+--------------------+-------------------+-----------------------+-------+
| ``'B'`` | unsigned char | int | 1 | |
+-----------+--------------------+-------------------+-----------------------+-------+
| ``'u'`` |Py_UNICODE | Unicode character | 2 | \(1) |
| ``'u'`` |wchar_t | Unicode character | 2 | \(1) |
+-----------+--------------------+-------------------+-----------------------+-------+
| ``'h'`` | signed short | int | 2 | |
+-----------+--------------------+-------------------+-----------------------+-------+
Expand All@@ -48,15 +48,16 @@ defined:
Notes:

(1)
The ``'u'`` type code corresponds to Python's obsolete unicode character
(:c:type:`Py_UNICODE` which is :c:type:`wchar_t`). Depending on the
platform, it can be 16 bits or 32 bits.
It can be 16 bits or 32 bits depending on the platform.

``'u'`` will be removed together with the rest of the :c:type:`Py_UNICODE`
API.
.. versionchanged:: 3.9
``array('u')`` now uses ``wchar_t`` as C type instead of deprecated
``Py_UNICODE``. This change doesn't affect to its behavior because
``Py_UNICODE`` is alias of ``wchar_t`` since Python 3.3.

.. deprecated-removed:: 3.3 4.0


The actual representation of values is determined by the machine architecture
(strictly speaking, by the C implementation). The actual size can be accessed
through the :attr:`itemsize` attribute.
Expand Down
2 changes: 1 addition & 1 deletionDoc/library/ast.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -35,7 +35,7 @@ Abstract Grammar
The abstract grammar is currently defined as follows:

.. literalinclude:: ../../Parser/Python.asdl
:language:none
:language:asdl


Node classes
Expand Down
2 changes: 1 addition & 1 deletionDoc/library/asyncio-task.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -575,7 +575,7 @@ Waiting Primitives
if task in done:
# Everything will work as expected now.

.. deprecated:: 3.8
.. deprecated-removed:: 3.8 3.11

Passing coroutine objects to ``wait()`` directly is
deprecated.
Expand Down
4 changes: 2 additions & 2 deletionsDoc/library/code.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -56,8 +56,8 @@ build applications which provide an interactive interpreter prompt.

*source* is the source string; *filename* is the optional filename from which
source was read, defaulting to ``'<input>'``; and *symbol* is the optional
grammar start symbol, which should beeither``'single'`` (the default) or
``'eval'``.
grammar start symbol, which should be ``'single'`` (the default), ``'eval'``
or``'exec'``.

Returns a code object (the same as ``compile(source, filename, symbol)``) if the
command is complete and valid; ``None`` if the command is incomplete; raises
Expand Down
5 changes: 3 additions & 2 deletionsDoc/library/codeop.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -43,8 +43,9 @@ To do just the former:
:exc:`OverflowError` or :exc:`ValueError` if there is an invalid literal.

The *symbol* argument determines whether *source* is compiled as a statement
(``'single'``, the default) or as an :term:`expression` (``'eval'``). Any
other value will cause :exc:`ValueError` to be raised.
(``'single'``, the default), as a sequence of statements (``'exec'``) or
as an :term:`expression` (``'eval'``). Any other value will
cause :exc:`ValueError` to be raised.

.. note::

Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp