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

Add snippet for `if __name__ == "__main__":` block #2881

Merged
merged 6 commits into from Oct 17, 2018

Conversation

Projects
None yet
3 participants
@rsnk96
Copy link

rsnk96 commented Oct 14, 2018

Added snippet to check if program is being run directly or imported without a separate main() function. (To address #2242 )

  • Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR)
  • Title summarizes what is changing
  • Has a news entry file (remember to thank yourself!)
  • Unit tests & system/integration tests are added/updated
  • Any new/changed dependencies in package.json are pinned (e.g. "1.2.3", not "^1.2.3" for the specified version)
  • package-lock.json has been regenerated by running npm install (if dependencies have changed)

rsnk96 added some commits Oct 13, 2018

Add snippet for #2242
Added snippet to check if program is being run directly or imported without a separate `main()` function (#2242)
@msftclas

This comment has been minimized.

Copy link

msftclas commented Oct 14, 2018

CLA assistant check
All CLA requirements met.

@brettcannon
Copy link
Member

brettcannon left a comment

Some very minor format tweaks.

Show resolved Hide resolved snippets/python.json Outdated
Show resolved Hide resolved snippets/python.json Outdated
Show resolved Hide resolved snippets/python.json Outdated
Show resolved Hide resolved snippets/python.json Outdated

brettcannon added some commits Oct 17, 2018

@rsnk96 rsnk96 changed the title Add snippet for `if __name__ == '__main__':` block Add snippet for `if __name__ == "__main__":` block Oct 17, 2018

@rsnk96

This comment has been minimized.

Copy link
Author

rsnk96 commented Oct 17, 2018

Updated @brettcannon

@brettcannon brettcannon merged commit 942f544 into Microsoft:master Oct 17, 2018

3 checks passed

VSCode-Python-CI #20181017.4 succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
license/cla All CLA requirements met.
Details
@brettcannon

This comment has been minimized.

Copy link
Member

brettcannon commented Oct 17, 2018

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.