| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| Expand Up | @@ -27,7 +27,7 @@ byte-code cache files in the directory containing the source code. | |
| Exception raised when an error occurs while attempting to compile the file. | ||
|
|
||
|
|
||
| .. function:: compile(file, cfile=None, dfile=None, doraise=False, optimize=-1, invalidation_mode=PycInvalidationMode.TIMESTAMP) | ||
| .. function:: compile(file, cfile=None, dfile=None, doraise=False, optimize=-1, invalidation_mode=PycInvalidationMode.TIMESTAMP, *, noopt=False) | ||
|
Comment thread
Outdated
Copy link
Copy Markdown
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Qualityoptimize and noopt. It looks slightly weird.
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityI know but I failed to find better names.
Sorry, something went wrong.
All reactions
|
||
|
|
||
| Compile a source file to byte-code and write out the byte-code cache file. | ||
| The source code is loaded from the file named *file*. The byte-code is | ||
| Expand Down Expand Up | @@ -60,6 +60,9 @@ byte-code cache files in the directory containing the source code. | |
| :func:`compile` function. The default of ``-1`` selects the optimization | ||
| level of the current interpreter. | ||
|
|
||
| If *noopt* is true, disable compiler optimizations and ignore *optimize* | ||
| argument. If it is ``None``, use ``sys.flags.noopt`` value. | ||
|
|
||
| *invalidation_mode* should be a member of the :class:`PycInvalidationMode` | ||
| enum and controls how the generated bytecode cache is invalidated at | ||
| runtime. The default is :attr:`PycInvalidationMode.CHECKED_HASH` if | ||
| Expand Down Expand Up | @@ -92,6 +95,9 @@ byte-code cache files in the directory containing the source code. | |
| .. versionchanged:: 3.8 | ||
| The *quiet* parameter was added. | ||
|
|
||
| .. versionchanged:: 3.9 | ||
| The *noopt* parameter was added. | ||
|
|
||
|
|
||
| .. class:: PycInvalidationMode | ||
|
|
||
| Expand Down | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| Expand Up | @@ -418,6 +418,7 @@ always available. | |
| :const:`inspect` :option:`-i` | ||
| :const:`interactive` :option:`-i` | ||
| :const:`isolated` :option:`-I` | ||
| :const:`noopt` :option:`-X noopt <-X>` | ||
| :const:`optimize` :option:`-O` or :option:`-OO` | ||
| :const:`dont_write_bytecode` :option:`-B` | ||
| :const:`no_user_site` :option:`-s` | ||
| Expand Down Expand Up | @@ -447,6 +448,9 @@ always available. | |
| Added ``dev_mode`` attribute for the new :option:`-X` ``dev`` flag | ||
| and ``utf8_mode`` attribute for the new :option:`-X` ``utf8`` flag. | ||
|
Comment thread
Outdated
Copy link
Copy Markdown
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityIf you want to change these two (and line 424-425) for consistent style :)
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityI chose to not change these on purpose, it would be an unrelated change. Someone can work on a PR to update these once this PR is merged ;-)
Sorry, something went wrong.
All reactions
|
||
|
|
||
| .. versionchanged:: 3.9 | ||
| Added ``noopt`` attribute for the new :option:`-X noopt <-X>` option. | ||
|
|
||
|
|
||
| .. data:: float_info | ||
|
|
||
| Expand Down | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| Expand Up | @@ -67,6 +67,14 @@ PyAPI_FUNC(PyCodeObject *) PyAST_CompileObject( | |
| PyCompilerFlags *flags, | ||
| int optimize, | ||
| PyArena *arena); | ||
| PyAPI_FUNC(PyCodeObject *) _PyAST_Compile( | ||
| struct _mod *mod, | ||
| PyObject *filename, | ||
| PyCompilerFlags *flags, | ||
| int optimization_level, | ||
| PyArena *arena, | ||
| int noopt); | ||
|
Comment thread
Outdated
Copy link
Copy Markdown
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityShould not it be controlled by flags or optimization_level?
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Qualityoptimization_level=0 still means having optimizations enabled. I cannot change to keep the backward compatibility. Do you think that it would be better to add a new PyCF_xxx flag to avoid adding this new function?
Sorry, something went wrong.
All reactions
|
||
|
|
||
| PyAPI_FUNC(PyFutureFeatures *) PyFuture_FromAST( | ||
| struct _mod * mod, | ||
| const char *filename /* decoded from the filesystem encoding */ | ||
| Expand Down | ||
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.