Commit Graph

3706 Commits

Author SHA1 Message Date
Pablo Galindo Salgado 395d4285bf
gh-98931: Improve error message when the user types 'import x from y' instead of 'from y import x' (#98932) 2022-11-01 13:01:20 +00:00
Jelle Zijlstra 5cf317ade1
gh-98658: Add __class_getitem__ to array.array (#98661)
Closes #98658
2022-10-31 21:10:18 -07:00
domragusa e089f23bbb
gh-84538: add strict argument to pathlib.PurePath.relative_to (GH-19813)
By default, :meth:`pathlib.PurePath.relative_to` doesn't deal with paths that are not a direct prefix of the other, raising an exception in that instance. This change adds a *walk_up* parameter that can be set to allow for using ``..`` to calculate the relative path.

example:
```
>>> p = PurePosixPath('/etc/passwd')
>>> p.relative_to('/etc')
PurePosixPath('passwd')
>>> p.relative_to('/usr')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "pathlib.py", line 940, in relative_to
    raise ValueError(error_message.format(str(self), str(formatted)))
ValueError: '/etc/passwd' does not start with '/usr'
>>> p.relative_to('/usr', strict=False)
PurePosixPath('../etc/passwd')
```


https://bugs.python.org/issue40358

Automerge-Triggered-By: GH:brettcannon
2022-10-28 16:20:14 -07:00
Erlend E. Aasland 723ebe76e7
gh-96143: Improve perf profiler docs (#96445) 2022-10-27 14:06:48 +01:00
Stanley 268129a74f
docs: Change links to label refs (#98454)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2022-10-25 20:26:28 -07:00
July Tikhonov 45644905ea
fix a typo in whatsnew/3.11 (#98603) 2022-10-25 16:42:54 -07:00
Jacob Walls faea6a131a
Fix typos in deprecation section of 3.11 What's New (#98628) 2022-10-25 16:35:53 -07:00
C.A.M. Gerlach dd13b23e49
gh-95913: Prepare Improved Modules in 3.11 WhatsNew for final edits (#98631)
* Add two line breaks and ref target labels to remaining subsections

* Fix a few out of order Improved Modules

* Fix a few minor textual formatting issues in sections

* Fix remaining Sphinx warnings in the Improved Modules section
2022-10-25 06:19:44 -07:00
Jelle Zijlstra c5a9d3f67f
gh-95913: Fix grammar for SpooledTemporaryFile 3.11 whatsnew entry (#98604)
Followup from #98312.
2022-10-24 09:45:43 -07:00
C.A.M. Gerlach e19c2b979f
gh-95913: Fix, sort & expand pending removal sect in 3.11 WhatsNew (GH-98583)
* Fix names/references of pending removal APIs

* Sort list of APIs pending removal alphabetically

* Add missing modules/submodules pending removal in 3.12

* Add table of unittest deprecated aliases to 3.11 What's New

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2022-10-24 15:35:28 +02:00
C.A.M. Gerlach f3f8b6fca5
gh-95913: Add io support for SpooledTemporaryFile in 3.11 Whatsnew (#98312) 2022-10-24 06:05:14 -07:00
C.A.M. Gerlach dfb5d272e6
gh-95913: Edit & expand Deprecated section of 3.11 WhatsNew (#98581)
* Refine Sphinx syntax and grammar/phrasing in Deprecated section items
* Organize into lang/builtins, modules & stdlib sections
* Convert PEP 594 module list into a grid to not waste as much space
* Add importlib.resources deprecated functions to section
2022-10-24 05:58:27 -07:00
C.A.M. Gerlach 22739a0e05
gh-95913: Edit, expand & format Bytecode sect in 3.11 WhatsNew (GH-98559) 2022-10-24 13:51:25 +01:00
C.A.M. Gerlach e81fad6b8a
gh-95913: Edit, link and sort 3.11 WhatsNew Build section (#98588) 2022-10-24 13:34:05 +01:00
C.A.M. Gerlach 43bef54a32
gh-95913: Edit, sort & expand 3.11 WhatsNew Porting section (#98585) 2022-10-24 13:33:31 +01:00
C.A.M. Gerlach 8dbec4dbe5
gh-95913: Edit, xref & sort 3.11 WhatsNew Removed section (#98584) 2022-10-24 13:33:16 +01:00
C.A.M. Gerlach e2dc223004
gh-95913 Add string section to Whatsnew with new Template methods (#98311) 2022-10-24 13:33:04 +01:00
Serhiy Storchaka 75a6fadf36
gh-91524: Speed up the regular expression substitution (#91525)
Functions re.sub() and re.subn() and corresponding re.Pattern methods
are now 2-3 times faster for replacement strings containing group references.

Closes #91524

Primarily authored by serhiy-storchaka Serhiy Storchaka
Minor-cleanups-by: Gregory P. Smith [Google] <greg@krypto.org>
2022-10-23 15:57:30 -07:00
C.A.M. Gerlach f58631be11
gh-95913: Edit & expand Optimizations in 3.11 WhatsNew (#98426) 2022-10-22 20:14:11 +01:00
C.A.M. Gerlach 8f30267ab4
gh-95913: Copyedit & xref FrameInfo in Whatsnew inspect section (#98304) 2022-10-22 20:12:04 +01:00
Carl Meyer 82ccbf69a8
gh-91051: allow setting a callback hook on PyType_Modified (GH-97875) 2022-10-21 14:41:51 +01:00
Rafael Fontenelle 52fcba6512
Doc: Remove title text from internal links (#98409)
Rely on the title of the linked internal page instead of putting the title. Sphinx will render with the title correctly, and this will reduce work for translators
2022-10-19 08:36:07 -07:00
C.A.M. Gerlach ed827d5608
gh-95913: Edit zipfile Whatsnew section & add new APIs (#98314)
* Link ZipFile in What's New entry discussing it

* Add entry for new ZipFile.mkdir method

* Add entry for new zipfile.Path.stem/suffix/suffixes methods

* Add missing line breaks between zipfile bullet list items
2022-10-19 06:33:50 +02:00
C.A.M. Gerlach 251b8ccd2a
gh-95913: Add WhatsNew section for new logging APIs (#98320)
* Add entry for new logging.getLevelNamesMapping function

* Add entry for SysLogHandler.createSocket to whatsnew

* Add missing line break between logging bullet list items
2022-10-19 06:25:58 +02:00
C.A.M. Gerlach fcae1954a2
gh-95914: Add links to 3.11 WhatsNew Summary items (#98416)
Add links to Summary items to where readers can learn more
2022-10-19 01:10:35 +02:00
Victor Stinner db03c8066a
gh-98393: os module reject bytes-like, only accept bytes (#98394)
The os module and the PyUnicode_FSDecoder() function no longer accept
bytes-like paths, like bytearray and memoryview types: only the exact
bytes type is accepted for bytes strings.
2022-10-18 17:52:31 +02:00
C.A.M. Gerlach 73e5180faf
gh-95913: Copyedit, xref and organize enum section (#98295)
* Whatsnew: Convert literals in enum section to actual x-references

* Whatsnew: Rewrite enum section for clear and consistant phrasing

* Whatsnew: Combine directly related enum items instead of seperating them

* gh-98250: Describe __str__/__format__ changes more clearly/accurately

* Tweak enum section language per feedback from Ethan
2022-10-18 11:26:24 +02:00
C.A.M. Gerlach 0a0c7e5a7a
gh-95913: Prepare remaining Whatsnew sections for editing (#98342)
* Add line breaks & ref targets to Whatsnew to prepare for future changes

* Use standard heading underbar symbols for H4 sections

* Flatten Porting subsection; clarify scope of/link Python->CAPI sections

* Move C API pending deprecations to C API section, to match the others
2022-10-18 10:41:57 +02:00
C.A.M. Gerlach 5fe0431474
gh-95913: Move subinterpreter exper removal to 3.11 WhatsNew (GH-98345)
Part of #95913
Forward port of #93306, which was a backport of #93185, to address #84694

This adds the What's New entry for the removal of the subinterpreter-related env variable, build-time flag, etc. As @ericsnowcurrently  was author of the original changes, I added him as a co-author to the commit.

This addition to the Python 3.11 What's New document were only made to the Python 3.11 branch during the backport process, and not added to the version in `main`. Forward-porting it ensures the docs retain these additions for the future, rather than being lost in a legacy Python versions, allows it to be be edited as part of #95913 , and avoids merge conflicts with routine back-ports of PRs touching it.

I've pulled in the addition exactly as-is with no modifications; any editing will be done in future PRs (and therefore can be reviewed and backported accordingly).

The one other such addition is forward-ported in #98344
2022-10-17 12:59:22 -07:00
C.A.M. Gerlach aafc53c0a6
gh-95914: Add What's New item describing PEP 670 changes (#98315) 2022-10-17 21:16:37 +02:00
C.A.M. Gerlach bb38b39b33
gh-95913: Forward-port int/str security change to 3.11 What's New in main (#98344)
Add int/str security change from issue gh-95778 PRs gh-96499 / gh-95800

Co-authored-by: Gregory P. Smith <greg@krypto.org> [Google]
2022-10-16 18:43:13 -07:00
Kumar Aditya 660f10248b
GH-94597: Deprecate child watcher getters and setters (#98215)
This is the next step for deprecating child watchers.

Until we've removed the API completely we have to use it, so this PR is mostly suppressing a lot of warnings when using the API internally.

Once the child watcher API is totally removed, the two child watcher implementations we actually use and need (Pidfd and Thread) will be turned into internal helpers.
2022-10-15 16:09:30 -07:00
Julien Palard 4067c6d7fe
gh-86404: Doc: Drop now unused make suspicious and rstlint. (GH-98179)
They have been replaced by
[sphinx-lint](https://github.com/sphinx-contrib/sphinx-lint).
2022-10-11 15:31:33 +02:00
Carl Meyer f1879690aa
Update whatsnew instructions for GitHub (#98124) 2022-10-10 00:29:25 +02:00
Kumar Aditya d8765284f3
GH-94597: deprecate `SafeChildWatcher`, `FastChildWatcher` and `MultiLoopChildWatcher` child watchers (#98089) 2022-10-08 13:52:19 -07:00
Pablo Galindo Salgado 83eb827247
gh-97922: Run the GC only on eval breaker (#97920) 2022-10-08 07:57:09 -07:00
Carl Meyer e82d977eb0
gh-91052: Add PyDict_Unwatch for unwatching a dictionary (#98055) 2022-10-07 17:37:46 -07:00
Hugo van Kemenade fa2d43e518
Docs: Fix backtick errors found by sphinx-lint (#97998)
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2022-10-06 18:01:30 -07:00
Brett Cannon e1c4d56fdd
gh-65961: Do not rely solely on `__cached__` (GH-97990)
Make sure `__spec__.cached` (at minimum) can be used.
2022-10-06 15:40:22 -07:00
Barry Warsaw effc25f7f2
Add Pynche's move to the What's new in 3.11 (#97974)
* Add Pynche's move to the What's new in 3.11

* Update Doc/whatsnew/3.11.rst

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2022-10-06 13:29:52 -07:00
Adam Turner f612565bd3
gh-93738: Disallow pre-v3 syntax in the C domain (#97962)
Also, disable using invalid sphinx-lint 0.6.2.
2022-10-06 10:11:37 -07:00
180909 cd0fde27f9
gh-95986: Fix the example using match keyword (#95989) 2022-10-06 09:52:21 -07:00
Brett Cannon c206e53bb7
gh-65961: Raise `DeprecationWarning` when `__package__` differs from `__spec__.parent` (#97879)
Also remove `importlib.util.set_package()` which was already slated for removal.

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2022-10-05 15:00:45 -07:00
Barry Warsaw 5dc3599135
gh-97850: Remove all known instances of module_repr() (#97876)
Remove all known instances of module_repr()
2022-10-05 11:42:26 -07:00
Adam Turner 0031e62973
gh-93738: Documentation C syntax (:c:type:<C type> -> :c:expr:<C type>) (#97768)
:c:type:`<C type>` -> :c:expr:`<C type>`

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2022-10-05 11:01:14 -07:00
Adam Turner 0e72606dd4
gh-93738: Documentation C syntax (Function glob patterns -> literal markup) (#97774) 2022-10-05 08:22:28 -07:00
Serhiy Storchaka e3ef400be7
gh-74696: Pass root_dir to custom archivers which support it (GH-94251)
Co-authored-by: Éric <merwok@netwok.org>
2022-10-05 12:48:59 +03:00
C.A.M. Gerlach 4e731814d7
gh-95913: Copyedit/improve Implementation Changes What's New section (#97720)
* Add and refine reST/Sphinx syntax for implementation changes section

* Clarify and refine wording in the Implementation Changes section

* Elide unnecessary comma

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2022-10-05 02:03:58 +02:00
Adam Turner 6b3d4db02e
gh-93738: Documentation C syntax (:c:type: to :c:expr:, misc. cases) (#97775)
* :c:type: to :c:expr:

* Update Doc/whatsnew/2.4.rst
2022-10-04 16:32:27 -07:00
Adam Turner a0f5599aac
gh-93738: Documentation C syntax (Use `c:struct`) (#97772)
Use `c:struct`
2022-10-04 16:26:14 -07:00