Skip to content

bpo-45132 Remove deprecated __getitem__ methods#28225

Merged
serhiy-storchaka merged 4 commits into
python:mainfrom
hugovk:rm-deprecated-__getitem__
Sep 8, 2021
Merged

bpo-45132 Remove deprecated __getitem__ methods#28225
serhiy-storchaka merged 4 commits into
python:mainfrom
hugovk:rm-deprecated-__getitem__

Conversation

@hugovk

@hugovk hugovk commented Sep 7, 2021

Copy link
Copy Markdown
Member

Remove deprecated __getitem__ methods of xml.dom.pulldom.DOMEventStream, wsgiref.util.FileWrapper and fileinput.FileInput, deprecated since Python 3.9.

https://bugs.python.org/issue45132

Remove deprecated __getitem__ methods of xml.dom.pulldom.DOMEventStream,
wsgiref.util.FileWrapper and fileinput.FileInput, deprecated since Python 3.9.

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, but I have some documentation nitpicks.

Comment thread Doc/library/fileinput.rst Outdated
Comment thread Doc/library/fileinput.rst Outdated
Comment thread Doc/library/wsgiref.rst Outdated
Comment thread Doc/library/wsgiref.rst Outdated
Comment thread Doc/library/wsgiref.rst Outdated
Comment thread Doc/library/xml.dom.pulldom.rst Outdated
hugovk and others added 2 commits September 8, 2021 10:50
`deprecated-removed` is only used for future planned removing. After removing it is just `versionchanged`.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Insert "In addition it is :term:`iterable` and has a ..."

deprecated-removed is only used for future planned removing.
After removing it is just versionchanged.
@hugovk

hugovk commented Sep 8, 2021

Copy link
Copy Markdown
Member Author

@serhiy-storchaka Thanks for the review, updated! Let me know if I should squash the commits or anything like that.

Thanks also for the guidance about deprecated-removed / versionchanged. I'd checked deprecated-removed in the devguide but it didn't say it's only for pre-removal; I'll make a PR to update the devguide.

https://devguide.python.org/documenting/?highlight=deprecated-removed#paragraph-level-markup

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

After removing deprecated features we remove deprecated directives.

@hugovk

hugovk commented Sep 8, 2021

Copy link
Copy Markdown
Member Author

After removing deprecated features we remove deprecated directives.

Ah right, so should I do this too?

-   .. deprecated:: 3.8
+   .. versionchanged:: 3.8
      Support for :meth:`__getitem__` method is deprecated.

@serhiy-storchaka

Copy link
Copy Markdown
Member

Replace deprecated with versionchanged, is deprecated with has been removed (or something like), and move the directive down if necessary. Since you already added versionchanged directives, just remove corresponding deprecated directives. They are not of interest to users of future Python versions.

Comment thread Doc/library/fileinput.rst Outdated

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@serhiy-storchaka serhiy-storchaka added the type-feature A feature request or enhancement label Sep 8, 2021
@serhiy-storchaka serhiy-storchaka merged commit d003a5b into python:main Sep 8, 2021
@hugovk hugovk deleted the rm-deprecated-__getitem__ branch September 8, 2021 10:13
@serhiy-storchaka

Copy link
Copy Markdown
Member

After reading the devguide I am no longer sure about deprecated-removed. Maybe I always used it incorrectly. Or its semantic was changed with time. It needs additional discussion.

@serhiy-storchaka

Copy link
Copy Markdown
Member

Opened a thread on Python-Dev: https://mail.python.org/archives/list/python-dev@python.org/thread/SWBM2N4EFPVQFP4TX6Q33L5OK2WPBFRU/ .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-feature A feature request or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants