Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
998b8063
Commit
998b8063
authored
Sep 12, 2018
by
Victor Stinner
Committed by
GitHub
Sep 12, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "bpo-34595: Add %T format to PyUnicode_FromFormatV() (GH-9080)" (GH-9187)
This reverts commit
886483e2
.
parent
acd282fd
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
66 deletions
+53
-66
Doc/c-api/unicode.rst
Doc/c-api/unicode.rst
+0
-6
Lib/test/test_unicode.py
Lib/test/test_unicode.py
+0
-4
Misc/NEWS.d/next/C API/2018-09-06-11-17-49.bpo-34595.Hkz62y.rst
...EWS.d/next/C API/2018-09-06-11-17-49.bpo-34595.Hkz62y.rst
+0
-4
Objects/unicodeobject.c
Objects/unicodeobject.c
+53
-52
No files found.
Doc/c-api/unicode.rst
View file @
998b8063
...
...
@@ -519,9 +519,6 @@ APIs:
| :attr:`%R` | PyObject\* | The result of calling |
| | | :c:func:`PyObject_Repr`. |
+-------------------+---------------------+--------------------------------+
| :attr:`%T` | PyObject\* | Object type name, equivalent |
| | | to ``Py_TYPE(op)->tp_name``. |
+-------------------+---------------------+--------------------------------+
An unrecognized format character causes all the rest of the format string to be
copied as-is to the result string, and any extra arguments discarded.
...
...
@@ -546,9 +543,6 @@ APIs:
Support width and precision formatter for ``"%s"``, ``"%A"``, ``"%U"``,
``"%V"``, ``"%S"``, ``"%R"`` added.
.. versionchanged:: 3.7
Support for ``"%T"`` (object type name) added.
.. c:function:: PyObject* PyUnicode_FromFormatV(const char *format, va_list vargs)
...
...
Lib/test/test_unicode.py
View file @
998b8063
...
...
@@ -2655,10 +2655,6 @@ class CAPITest(unittest.TestCase):
check_format
(
r"%A:'abc\xe9\uabcd\U0010ffff'"
,
b'%%A:%A'
,
'abc
\
xe9
\
uabcd
\
U0010ffff
'
)
# test %T (object type name)
check_format
(
r"type name: str"
,
b'type name: %T'
,
'text'
)
# test %V
check_format
(
'repr=abc'
,
b'repr=%V'
,
'abc'
,
b'xyz'
)
...
...
Misc/NEWS.d/next/C API/2018-09-06-11-17-49.bpo-34595.Hkz62y.rst
deleted
100644 → 0
View file @
acd282fd
:c:func:`PyUnicode_FromFormatV`: add ``%T`` format to
:c:func:`PyUnicode_FromFormatV`, and so to :c:func:`PyUnicode_FromFormat`
and :c:func:`PyErr_Format`, to format an object type name: equivalent to
"%s" with ``Py_TYPE(obj)->tp_name``.
Objects/unicodeobject.c
View file @
998b8063
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment