GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||
GeezerVison is showing github.com — gh-66436: Improved prog default value for argparse.ArgumentParser by serhiy-storchaka · Pull Request #124799 · python/cpython Conversation
|
| if (modspec.name == '__main__' and not modspec.parent and modspec.has_location | ||
| and _os.path.dirname(modspec.origin) == _os.path.join(_os.getcwd(), arg0)): |
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Actually, it seems that this condition can be simplified to simply modspec.name == '__main__'. What are your thoughts @ncoghlan?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Actually, additionally checks were just an obstacle, because of differences in normalization between Unix and Windows. So I removed them.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Assorted minor comments inline, either tweaking docs wording, or else making the code handle obscure edge cases more gracefully.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Co-authored-by: Alyssa Coghlan <[email protected]>
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your suggestions @ncoghlan. I applied them all.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.