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
d3013ffa
Commit
d3013ffa
authored
Nov 11, 2008
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
exec won't take file objects anymore
parent
3e4e72f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
Doc/library/functions.rst
Doc/library/functions.rst
+8
-9
No files found.
Doc/library/functions.rst
View file @
d3013ffa
...
...
@@ -391,16 +391,15 @@ are always available. They are listed here in alphabetical order.
.. function:: exec(object[, globals[, locals]])
This function supports dynamic execution of Python code. *object* must be either
a string, an open file object, or a code object. If it is a string, the string
is parsed as a suite of Python statements which is then executed (unless a
syntax error occurs). If it is an open file, the file is parsed until EOF and
executed. If it is a code object, it is simply executed. In all cases, the
This function supports dynamic execution of Python code. *object* must be
either a string or a code object. If it is a string, the string is parsed as
a suite of Python statements which is then executed (unless a syntax error
occurs). If it is a code object, it is simply executed. In all cases, the
code that'
s
executed
is
expected
to
be
valid
as
file
input
(
see
the
section
"File input"
in
the
Reference
Manual
).
Be
aware
that
the
:
keyword
:`
return
`
and
:
keyword
:`
yield
`
statements
may
not
be
used
outside
of
function
definitions
eve
n
within
the
context
of
code
passed
to
the
:
func
:`
exec
`
function
.
The
return
value
is
``
None
``.
"File input"
in
the
Reference
Manual
).
Be
aware
that
the
:
keyword
:`
return
`
and
:
keyword
:`
yield
`
statements
may
not
be
used
outside
of
functio
n
definitions
even
within
the
context
of
code
passed
to
the
:
func
:`
exec
`
function
.
The
return
value
is
``
None
``.
In
all
cases
,
if
the
optional
parts
are
omitted
,
the
code
is
executed
in
the
current
scope
.
If
only
*
globals
*
is
provided
,
it
must
be
a
dictionary
,
which
...
...
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