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

rsnk96
Copy link

@rsnk96 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)

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

msftclas commented Oct 14, 2018

CLA assistant check
All CLA requirements met.

Copy link
Member

@brettcannon brettcannon left a comment

Choose a reason for hiding this comment

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

Some very minor format tweaks.

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 Show resolved Hide resolved
@rsnk96 rsnk96 changed the title Add snippet for if __name__ == '__main__': block Add snippet for if __name__ == "__main__": block Oct 17, 2018
@rsnk96
Copy link
Author

rsnk96 commented Oct 17, 2018

Updated @brettcannon

@brettcannon brettcannon merged commit 942f544 into microsoft:master Oct 17, 2018
@brettcannon
Copy link
Member

Thanks!

@lock lock bot locked as resolved and limited conversation to collaborators Jul 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants