| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
Can you add tests and fix the sphinx markup?
Sorry, something went wrong.
|
Please add a unittest and document. Also add to 3.14 what's new(recommend) |
Sorry, something went wrong.
|
One of the tests is currently failing because you also need to add the new test folder to the Makefile: Line 2500 in 7b04496 should be: test/test_inspect \
+ test/test_inspect/inspect_simple_pkg \ |
Sorry, something went wrong.
|
LGTM |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM.
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks!
Sorry, something went wrong.
|
@brettcannon @ncoghlan: Is it the correct way to check if a module a package, ismodule(object) and hasattr(object, "__path__")? |
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks! Several comments :)
Sorry, something went wrong.
|
I'm not sure __path__ is mandatory anymore, as I believe it's just a way to override __spec__. I'll double check the importlib code. Edit: after checking the importlib code, I'm happy simply looking for __path__ is still the right check for runtime introspection. importlib itself handles merging __path__, __spec__.is_package and __spec__.submodule_search_locations into a single final __path__ list when it creates the import package module instances. This also keeps things consistent with the glossary's definition of a package as a module with a __path__ attribute. |
Sorry, something went wrong.
|
Thanks for the PR @Xiaokang2022, and thanks for the prior reviews all! |
Sorry, something went wrong.
| self.istest(inspect.ispackage, 'importlib') | ||
| self.assertFalse(inspect.ispackage(inspect)) | ||
| self.assertFalse(inspect.ispackage(mod)) | ||
| self.assertFalse(inspect.ispackage(':)')) |
There was a problem hiding this comment.
This last test genuinely made me laugh :)
Sorry, something went wrong.
…#125634) --------- Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.