Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
933142a8
Commit
933142a8
authored
Dec 06, 2013
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
document that compile() can take bytes (closes #19910)
parent
d4d60554
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
Doc/library/functions.rst
Doc/library/functions.rst
+3
-3
Python/bltinmodule.c
Python/bltinmodule.c
+1
-1
No files found.
Doc/library/functions.rst
View file @
933142a8
...
...
@@ -193,9 +193,9 @@ are always available. They are listed here in alphabetical order.
.. function:: compile(source, filename, mode, flags=0, dont_inherit=False, optimize=-1)
Compile the *source* into a code or AST object. Code objects can be executed
by :func:`exec` or :func:`eval`. *source* can either be a
string or an AST
object. Refer to the :mod:`ast` module documentation for information on how
to work with AST objects.
by :func:`exec` or :func:`eval`. *source* can either be a
normal string, a
byte string, or an AST object. Refer to the :mod:`ast` module documentation
for information on how
to work with AST objects.
The *filename* argument should give the file from which the code was read;
pass some recognizable value if it wasn't read from a file (``'<string>'`` is
...
...
Python/bltinmodule.c
View file @
933142a8
...
...
@@ -676,7 +676,7 @@ finally:
PyDoc_STRVAR
(
compile_doc
,
"compile(source, filename, mode[, flags[, dont_inherit]]) -> code object
\n
\
\n
\
Compile the source
string
(a Python module, statement or expression)
\n
\
Compile the source (a Python module, statement or expression)
\n
\
into a code object that can be executed by exec() or eval().
\n
\
The filename will be used for run-time error messages.
\n
\
The mode must be 'exec' to compile a module, 'single' to compile a
\n
\
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment