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

Change __name__ to '__main__' #692

Closed
wants to merge 1 commit into from
Closed

Conversation

@afrieder
Copy link
Contributor

afrieder commented Jul 8, 2017

The behavior of other repls (python and ipython) is to set __name__ to '__main__'. You can test this by simply printing __name__ or by running bpython on some file that has a __name__ == '__main__' guard. This was first changed in #506 but as noted in that issue, the original reason for changing has been lost. Since __name__ == '__main__' is so common (it appears 16 times in this codebase alone), it's a significant annoyance to not be able to run files in bpython with that guard. I request you change it back to this more useful behavior.

@afrieder
Copy link
Contributor Author

afrieder commented Jul 8, 2017

(As you can probably tell by all these PRs, I've been using bpython a lot recently. It's awesome and I thank you so much for all the hard work that's been put in so far)

@sebastinas
Copy link
Contributor

sebastinas commented Jul 10, 2017

Wouldn't that break -i again?

@afrieder afrieder closed this Jul 10, 2017
@afrieder afrieder deleted the afrieder:__name__ branch Jul 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.