FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-105922: Refactor PyRun_InteractiveOneObjectEx() by vstinner · Pull Request #105925 · python/cpython · GitHub

/ cpython Public

gh-105922: Refactor PyRun_InteractiveOneObjectEx() - #105925

Merged
vstinner merged 1 commit into
python:mainfrom
vstinner:pythonrun
Jun 19, 2023
Merged

gh-105922: Refactor PyRun_InteractiveOneObjectEx()#105925
vstinner merged 1 commit into
python:mainfrom
vstinner:pythonrun

Conversation

vstinner commented Jun 19, 2023
edited by bedevere-bot
Loading

Copy link
Copy Markdown
Member

Refactor PyRun_InteractiveOneObjectEx(), _PyRun_SimpleFileObject() and PyRun_SimpleStringFlags():

  • Keep a strong reference to the main module while using its dictionary (PyModule_GetDict()). Use PyImport_AddModule() with Py_XNewRef().
  • Declare variables closer to where they are defined.
  • Rename variables to use name longer than 1 character.
  • Add pyrun_one_parse_ast() sub-function.

Refactor PyRun_InteractiveOneObjectEx(), _PyRun_SimpleFileObject()
and PyRun_SimpleStringFlags():

* Keep a strong reference to the __main__ module while using its
  dictionary (PyModule_GetDict()). Use PyImport_AddModule() with
  Py_XNewRef().
* Declare variables closer to where they are defined.
* Rename variables to use name longer than 1 character.
* Add pyrun_one_parse_ast() sub-function.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL