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

gh-125633: Add function ispackage to stdlib inspect #125634

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

Xiaokang2022
Copy link
Contributor

@Xiaokang2022 Xiaokang2022 commented Oct 17, 2024

Copy link
Contributor

@nineteendo nineteendo left a comment

Choose a reason for hiding this comment

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

Can you add tests and fix the sphinx markup?

@Wulian233
Copy link
Contributor

Please add a unittest and document.

Also add to 3.14 what's new(recommend)

@tomasr8
Copy link
Member

tomasr8 commented Oct 17, 2024

One of the tests is currently failing because you also need to add the new test folder to the Makefile:

test/test_inspect \

should be:

  test/test_inspect \
+ test/test_inspect/inspect_simple_pkg \

@Xiaokang2022 Xiaokang2022 changed the title gh-125633: Adding function ispackage to stdlib inspect gh-125633: Add function ispackage to stdlib inspect Oct 17, 2024
@Wulian233
Copy link
Contributor

LGTM

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM.

Doc/library/inspect.rst Show resolved Hide resolved
Doc/library/inspect.rst Outdated Show resolved Hide resolved
Doc/whatsnew/3.14.rst Outdated Show resolved Hide resolved
Lib/inspect.py Outdated Show resolved Hide resolved
Copy link
Member

@Eclips4 Eclips4 left a comment

Choose a reason for hiding this comment

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

Thanks!

@vstinner
Copy link
Member

@brettcannon @ncoghlan: Is it the correct way to check if a module a package, ismodule(object) and hasattr(object, "__path__")?

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

Thanks! Several comments :)

Lib/test/test_inspect/test_inspect.py Show resolved Hide resolved
Lib/test/test_inspect/test_inspect.py Outdated Show resolved Hide resolved
Makefile.pre.in Outdated Show resolved Hide resolved
@erlend-aasland erlend-aasland removed their request for review October 21, 2024 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants