Code comments extras #7
Replies: 3 comments
-
|
Beta Was this translation helpful? Give feedback.
-
Finding the path of a module.Is the following the best way to get the path to the local directory that has the code for a given module? What problems might this solution have? What other solutions might you propose? What problems might they have? # if pkg_dir is a module object, get the path to the module
if isinstance(pkg_dir, ModuleType):
pkg_dir = os.path.dirname(pkg_dir.__file__) Using Current Approachif isinstance(pkg_dir, ModuleType):
pkg_dir = os.path.dirname(pkg_dir.__file__) Pros:
Cons:
Alternative Solutions1. Using
|
Beta Was this translation helpful? Give feedback.
-
Getting versionsHere's a function that gets four opinions of versions. from wads.pack import versions_from_different_sources
versions_from_different_sources('dol')
Implementing these rules for validation in validate_versions |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This is a place to dump extra commentary about code, commits, architecture, that we may want to have a link for, which we can then use in code comments to direct the reader here, or in various documenting resources.
Beta Was this translation helpful? Give feedback.
All reactions