Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Change __name__ to '__main__'#692

Closed
afrieder wants to merge 1 commit intobpython:masterfrom
afrieder:__name__
Closed

Change __name__ to '__main__'#692
afrieder wants to merge 1 commit intobpython:masterfrom
afrieder:__name__

Conversation

@afrieder
Copy link
Contributor

The behavior of other repls (python andipython) 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
ContributorAuthor

(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

Wouldn't that break-i again?

@afriederafrieder deleted the __name__ branchJuly 10, 2017 23:50
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@afrieder@sebastinas

[8]ページ先頭

©2009-2026 Movatter.jp