Adorilson Bezerra
51a56a3a7b
gh-106318: Add examples for str.casefold() and str.lower() methods ( #142154 )
...
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-01-07 16:16:25 +00:00
Adorilson Bezerra
4fb6a31bce
gh-106318: Add example for str.index() ( #137023 )
2026-01-06 23:42:11 +02:00
Adorilson Bezerra
7b0a372b20
gh-106318: Add examples for str.isprintable() ( #140043 )
...
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2026-01-06 17:43:44 +01:00
Stan Ulbrych
3c0888b25b
gh-89152: Note truth testing exception in stdtypes.rst ( #137640 )
...
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2025-12-22 11:36:44 -08:00
Mohsin Mehmood
b372bd7295
gh-141218: Fix inaccurate object comparison documentation ( #141221 )
...
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-12-16 13:46:42 +02:00
Owain Davies
a15bd217b2
Remove duplicate content in Mapping types - dict documentation ( #141036 )
2025-12-16 13:46:13 +02:00
Adorilson Bezerra
ec2619c080
gh-106318: Add examples for str.ljust() method ( #142719 )
...
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-12-16 13:39:20 +02:00
Bartosz Sławecki
a44509ea87
gh-139320: Cover exception chaining in the docs of contextmanager.__exit__ (GH-140169)
2025-12-16 11:15:37 +01:00
Adorilson Bezerra
3596dba691
gh-106318: Add examples for str.isnumeric() ( #142680 )
...
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-12-14 20:12:12 +02:00
Serhiy Storchaka
1d8f3ed2eb
gh-101100: Fix references to the set methods (GH-141857)
2025-12-05 16:22:38 +02:00
Petr Viktorin
aea5531583
gh-135676: Reword the f-string (and t-string) section (GH-137469)
...
Much of the information was duplicated in stdtypes.rst; this PR keeps lexical/syntactical details in Lexical Analysis and the evaluation & runtime behaviour in Standard types, with cross-references between the two.
Since the t-string section only listed differences from f-strings, and the grammar for the two is equivalent, that section was moved to Standard types almost entirely.
Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-12-03 16:14:53 +01:00
Cody Maloney
d2d2e92110
Docs: Move to method references for bytearray.take_bytes ( #142053 )
2025-11-28 22:07:34 +01:00
Guo Ci
8c33c6143e
Correct indentation in stdtypes.rst ( #141957 )
2025-11-26 11:55:52 +05:30
Adorilson Bezerra
fb655527d8
gh-106318: Add examples for str.join() ( #140315 )
...
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-11-24 16:53:25 +02:00
Adorilson Bezerra
0cde70bde0
gh-106318: Add example for str.format() ( #137018 )
2025-11-24 16:51:10 +02:00
Adorilson Bezerra
0387a8e0f7
gh-106318: Add example for str.isalpha() ( #137557 )
...
Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-11-24 14:10:35 +00:00
Adorilson Bezerra
0afcb51d17
gh-106318: Add example for str.isascii() ( #137558 )
...
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-11-24 16:02:18 +02:00
Adorilson Bezerra
6462322840
gh-106318: Add example for str.isdecimal() ( #137559 )
...
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-11-24 11:47:54 +00:00
Adam Turner
cde19e565c
GH-101100: Resolve reference warnings in library/stdtypes.rst ( #138420 )
2025-11-22 19:23:29 +00:00
Hugo van Kemenade
a62562859d
Python 3.15.0a2
2025-11-18 16:51:17 +02:00
Cody Maloney
732224e113
gh-139871: Add bytearray.take_bytes([n]) to efficiently extract bytes (GH-140128)
...
Update `bytearray` to contain a `bytes` and provide a zero-copy path to
"extract" the `bytes`. This allows making several code paths more efficient.
This does not move any codepaths to make use of this new API. The documentation
changes include common code patterns which can be made more efficient with
this API.
---
When just changing `bytearray` to contain `bytes` I ran pyperformance on a
`--with-lto --enable-optimizations --with-static-libpython` build and don't see
any major speedups or slowdowns with this; all seems to be in the noise of
my machine (Generally changes under 5% or benchmarks that don't touch
bytes/bytearray).
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Maurycy Pawłowski-Wieroński <5383+maurycy@users.noreply.github.com>
2025-11-13 13:19:44 +00:00
Tan Long
2ebd0cdb16
Remove duplicate words in the documentation ( #140221 )
2025-10-16 18:27:00 +01:00
Adorilson Bezerra
07e617ecc2
gh-106318: Add examples for str.istitle() ( #140046 )
2025-10-14 17:19:27 +03:00
Alex Waygood
530ddd3e06
Revert "gh-118803: Remove ByteString from typing and collections.abc ( #118804 )" ( #138990 )
2025-09-16 16:48:19 +01:00
Benjamin Peterson
5bd4bf04c4
closes gh-138706: update Unicode to 17.0.0 ( #138719 )
2025-09-11 09:58:39 -07:00
Adam Turner
22cb9ba8f9
GH-101100: Remove some entries from `nitpick_ignore` ( #138464 )
2025-09-08 22:10:26 +00:00
Adam Turner
8ed1d53e62
GH-138465: Improve documentation for common sequence methods ( #138474 )
...
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-09-05 20:55:02 +01:00
Adorilson Bezerra
88665de120
gh-138307: Update the Ellipsis documentation ( #138306 )
...
* Doc: Change Ellipsis doc at library/constants
* Doc: Change Ellipsis doc at library/stdtypes
* Doc: Add NumPy reference into Ellipsis doc at library/stdtypes
* Doc: Add Ellipsis reference into the pass statement section at tutorial
* Doc: Update Ellipsis doc concerns assignments at library/constants
* Update Doc/library/stdtypes.rst
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
* Doc: Fix grammar on Ellipsis docs (library/constants.rst)
Co-authored-by: Éric <merwok@netwok.org>
* Doc: Fix grammar on Ellipsis docs (library/stdtypes.rst)
Co-authored-by: Éric <merwok@netwok.org>
* Doc: Fix grammar on Ellipsis docs (library/stdtypes.rst)
Co-authored-by: Éric <merwok@netwok.org>
* Doc: Remove pretty printers reference from Ellipsis doc at library/stdtypes
* Doc: Update index concerns Ellipsis object and pass statement
* Doc: Improve Ellipsis doc at library/constants
* Doc: Improve Ellipsis doc at library/stdtypes
* Doc: Change the "..." glossary entry to mention the Ellipsis object
* Doc: Some improvements concern ellipsis into typing doc
* Minor update Doc/tutorial/controlflow.rst
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
* Update Doc/library/constants.rst
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
* Update Doc/library/stdtypes.rst
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
---------
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2025-09-03 07:27:22 -04:00
Blaise Pabon
14a5ad1db1
gh-106318: Add example for str.find() ( #134529 )
...
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-08-27 09:42:00 +03:00
Serhiy Storchaka
65fb4d11a0
gh-137609: Update signatures of builtins in the documentation (GH-137610)
...
Show signatures that match the actual signatures or future multisignatures
for all functions, classes and methods in the "builtins" module.
2025-08-25 15:28:27 +03:00
Adam Turner
4dae9b1ff1
gh-132661: PEP 750 documentation: second pass ( #137020 )
2025-08-04 22:45:51 +01:00
Dave Peck
22c8658906
gh-132661: Document t-strings and templatelib ( #135229 )
...
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Loïc Simon <loic.pano@gmail.com>
Co-authored-by: pauleveritt <pauleveritt@me.com>
2025-07-22 12:44:13 +03:00
Yongzi Li
609d5adc7c
gh-134833: improve docs for del s[i:j] in Mutable Sequence Types ( #134834 )
2025-07-13 11:26:31 +05:30
Blaise Pabon
14c1d093d5
gh-106318: Add example for str.expandtabs() ( #134525 )
2025-06-13 18:44:21 +03:00
Blaise Pabon
eed827ed09
gh-106318: Add example for str.endswith() ( #134523 )
...
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-06-13 11:54:16 +00:00
Blaise Pabon
273459562e
gh-106318: Add example for str.encode() ( #134520 )
...
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-06-13 11:32:07 +00:00
Yongzi Li
158e5162bf
gh-134976: document the exception type that can be raised by s[i] ( #134977 )
2025-06-08 14:28:55 +02:00
Rishabh Singh
967f361993
gh-134789: Document del s[i] operation for mutable sequences ( #134804 )
...
[main] Update stdtypes.rst
- Added explicit mention of `del s[i]` (item deletion by index) to the Mutable Sequence Types section.
- Clarified that this operation removes the item at the specified index from the sequence.
- Addresses issue #134789 .
2025-05-27 14:48:04 -04:00
Blaise Pabon
1729468016
gh-106318: Add example for str.count() ( #134519 )
2025-05-23 12:47:11 +03:00
Blaise Pabon
da9b5c1c9c
gh-106318: Add example for str.center() ( #134518 )
2025-05-23 12:44:15 +03:00
Joey Smith
3e23047363
gh-133986: Document string split algorithm when sep is None and maxsplit is 0 ( #133987 )
...
* Document string split algorithm when sep is None and maxsplit is 0
* Update Doc/library/stdtypes.rst
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
---------
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
2025-05-14 06:17:26 -04:00
Yongzi Li
076004ae54
Docs: use boolean constants for returning boolean value (GH-133325)
2025-05-09 17:11:50 +03:00
Yongzi Li
61ac88c06e
gh-133361: move the explanation of dict equal before its use ( #133424 )
...
Also move up the explanation of insertion order preservation. Both paragraphs seemed out of place down where they were.
---------
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2025-05-07 18:04:49 -04:00
Adam Turner
fee808936f
gh-85583: Add an overview of formatted string literals (f-strings) to `str` ( #132689 )
2025-04-21 07:49:06 +00:00
Adam Dangoor
edfbd8c062
gh-131885: Document that dict.setdefault and dict.get take no keyword arguments ( #128208 )
2025-03-30 09:22:57 +00:00
Andrew Svetlov
61b4b2c57c
gh-131417: Mention asyncio Future and Task in docs for generic classes list ( #131422 )
...
Mention asyncio Future and Task in docs for generic classes list
2025-03-19 10:05:23 +01:00
Hugo van Kemenade
77b2c933ca
Python 3.14.0a6
2025-03-14 17:05:02 +02:00
Daniel Pope
e0637cebe5
gh-129349: Accept bytes in bytes.fromhex()/bytearray.fromhex() ( #129844 )
...
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-03-12 11:40:11 +01:00
Jelle Zijlstra
dc6d66f44c
gh-105499: Merge typing.Union and types.UnionType ( #105511 )
...
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Ken Jin <kenjin@python.org>
Co-authored-by: Carl Meyer <carl@oddbird.net>
2025-03-04 11:44:19 -08:00
Yuki Kobayashi
4d3a7ea354
Docs: Fix some semantic usages of iterator.__iter__ (GH-130172)
...
These references to an `__iter__` method mean `object.__iter__`, not `iterator.__iter__`.
2025-02-25 13:38:47 +01:00