Content-Length: 287724 | pFad | https://github.com/python/cpython/pull/105925

0B gh-105922: Refactor PyRun_InteractiveOneObjectEx() by vstinner · Pull Request #105925 · python/cpython · GitHub
Skip to content

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

@vstinner vstinner commented Jun 19, 2023

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.
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









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/python/cpython/pull/105925

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy