gh-65961: Raise `DeprecationWarning` when `__package__` differs from `__spec__.parent` by brettcannon · Pull Request #97879 · python/cpython · GitHub

github.com

Tin mới

brettcannon:deprecate-__package__

GitHub CopilotWrite better code with AI

GitHub Copilot appDirect agents from issue to merge

ActionsAutomate any workflow

CodespacesInstant dev environments

IssuesPlan and track work

Code ReviewManage code changes

Code QualityEnforce quality at merge

GitHub Advanced SecurityFind and fix vulnerabilities

Code securitySecure your code as you build

Secret protectionStop leaks before they start

View all use cases

Financial services

View all industries

Software Development

GitHub SponsorsFund open source developers

Copilot for BusinessEnterprise-grade AI features

Premium SupportEnterprise-grade 24/7 support

Pull requests 2.6k

Security and quality 0

update the import machinery to only use __spec__ #65961

gh-65961: Raise `DeprecationWarning` when `__package__` differs from `__spec__.parent` Also remove `importlib.util.set_package()` which was already slated for removal.

awaiting core review

Merge branch 'main' into deprecate-__package__

List the removal of __package__ in What's New

Merge branch 'deprecate-__package__' of

https://github.com/brettcanno…

View reviewed changes

Learn more about hiding disruptive comments

The reason will be displayed to describe this comment to others. Learn more.

Update Misc/NEWS.d/next/Core and Builtins/2022-10-05-00-37-27.gh-issu…

Make a strong recommendation to use __spec__

awaiting change review

View reviewed changes

Merge branch 'main' into dictwatch

Merge branch 'main' into typewatch

DeprecationWarning

__package__ will cease being set/used in Python 3.15 swig/swig#2967

Python 3.14 support mitogen-hq/mitogen#1242

Remove support for __cached__ and __package__ if missing corresponding __spec__ attributes #134088

builtins: advance Python 3.14 type and protocol parity youknowone/pyre#713