Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MimeTypes.add_type() is missing from the docs #121658

Closed
steverep opened this issue Jul 13, 2024 · 9 comments
Closed

MimeTypes.add_type() is missing from the docs #121658

steverep opened this issue Jul 13, 2024 · 9 comments
Assignees
Labels
3.12 bugs and security fixes 3.13 bugs and security fixes 3.14 new features, bugs and security fixes docs Documentation in the Doc dir easy

Comments

@steverep
Copy link

steverep commented Jul 13, 2024

Bug report

Bug description:

from mimetypes import MimeTypes

m = MimeTypes()
m.add_type # type checking error

The add_type method is not defined on the class interface, and also not defined in the RST file for the docs.

CPython versions tested on:

3.8, 3.9, 3.10, 3.11, 3.12, 3.13, CPython main branch

Operating systems tested on:

Linux, macOS, Windows

Linked PRs

@steverep steverep added the type-bug An unexpected behavior, bug, or error label Jul 13, 2024
@tomasr8
Copy link
Member

tomasr8 commented Jul 13, 2024

Seems like the add_type method is missing from typeshed:
https://github.com/python/typeshed/blob/6a9b53e719a139c2d6b41cf265ed0990cf438192/stdlib/mimetypes.pyi#L42

@Eclips4
Copy link
Member

Eclips4 commented Jul 13, 2024

Hello! Thanks for the report.
As @tomasr8 said, type checking error is coming from the fact that Mimetypes.add_type isn't defined in the typeshed stubs. Actually, yes, we need to update our docs to add this method. Would you like to send a pull request?

@Eclips4 Eclips4 added docs Documentation in the Doc dir 3.12 bugs and security fixes 3.13 bugs and security fixes 3.14 new features, bugs and security fixes and removed type-bug An unexpected behavior, bug, or error labels Jul 13, 2024
@Eclips4
Copy link
Member

Eclips4 commented Jul 13, 2024

FYI, here's the PR for typeshed: python/typeshed#12329

@Eclips4 Eclips4 changed the title MimeTypes.add_type() missing from types and docs MimeTypes.add_type() is missing from the docs Jul 13, 2024
@Eclips4 Eclips4 added the easy label Jul 13, 2024
@stinovlas
Copy link
Contributor

I'm working on this during EuroPython 2024 sprint.

@stinovlas
Copy link
Contributor

I'm working on this during EuroPython 2024 sprint.

Fixed in #121665.

stinovlas added a commit to stinovlas/cpython that referenced this issue Jul 13, 2024
stinovlas added a commit to stinovlas/cpython that referenced this issue Jul 13, 2024
@RafaelJohn9
Copy link

@Eclips4 has this issue been fixed? if not I would like to be assignedd

@Eclips4
Copy link
Member

Eclips4 commented Aug 14, 2024

@Eclips4 has this issue been fixed? if not I would like to be assignedd

There's an existing PR which solves the issue: #121665. We're just waiting for someone with ability to merge it.

@RafaelJohn9
Copy link

Aah nice 👍🙂

stinovlas added a commit to stinovlas/cpython that referenced this issue Aug 22, 2024
@hugovk
Copy link
Member

hugovk commented Nov 6, 2024

Was added in #122301, thanks!

@hugovk hugovk closed this as completed Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.12 bugs and security fixes 3.13 bugs and security fixes 3.14 new features, bugs and security fixes docs Documentation in the Doc dir easy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants