Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
ba0b915f
Commit
ba0b915f
authored
Jun 07, 2011
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add flag for archaic behavior of globals().
parent
ff2fcf40
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
2 deletions
+12
-2
Cython/Compiler/Builtin.py
Cython/Compiler/Builtin.py
+6
-2
Cython/Compiler/CmdLine.py
Cython/Compiler/CmdLine.py
+2
-0
Cython/Compiler/Options.py
Cython/Compiler/Options.py
+4
-0
No files found.
Cython/Compiler/Builtin.py
View file @
ba0b915f
...
@@ -7,6 +7,7 @@ from Code import UtilityCode
...
@@ -7,6 +7,7 @@ from Code import UtilityCode
from
TypeSlots
import
Signature
from
TypeSlots
import
Signature
import
PyrexTypes
import
PyrexTypes
import
Naming
import
Naming
import
Options
# C-level implementations of builtin types, functions and methods
# C-level implementations of builtin types, functions and methods
...
@@ -413,8 +414,6 @@ builtin_function_table = [
...
@@ -413,8 +414,6 @@ builtin_function_table = [
utility_code
=
getattr3_utility_code
),
utility_code
=
getattr3_utility_code
),
BuiltinFunction
(
'getattr3'
,
"OOO"
,
"O"
,
"__Pyx_GetAttr3"
,
"getattr"
,
BuiltinFunction
(
'getattr3'
,
"OOO"
,
"O"
,
"__Pyx_GetAttr3"
,
"getattr"
,
utility_code
=
getattr3_utility_code
),
# Pyrex compatibility
utility_code
=
getattr3_utility_code
),
# Pyrex compatibility
BuiltinFunction
(
'globals'
,
""
,
"O"
,
"__Pyx_Globals"
,
utility_code
=
globals_utility_code
),
BuiltinFunction
(
'hasattr'
,
"OO"
,
"b"
,
"PyObject_HasAttr"
),
BuiltinFunction
(
'hasattr'
,
"OO"
,
"b"
,
"PyObject_HasAttr"
),
BuiltinFunction
(
'hash'
,
"O"
,
"h"
,
"PyObject_Hash"
),
BuiltinFunction
(
'hash'
,
"O"
,
"h"
,
"PyObject_Hash"
),
#('hex', "", "", ""),
#('hex', "", "", ""),
...
@@ -462,6 +461,11 @@ builtin_function_table = [
...
@@ -462,6 +461,11 @@ builtin_function_table = [
BuiltinFunction
(
'__Pyx_PyObject_Append'
,
"OO"
,
"O"
,
"__Pyx_PyObject_Append"
),
BuiltinFunction
(
'__Pyx_PyObject_Append'
,
"OO"
,
"O"
,
"__Pyx_PyObject_Append"
),
]
]
if
not
Options
.
old_style_globals
:
builtin_function_table
.
append
(
BuiltinFunction
(
'globals'
,
""
,
"O"
,
"__Pyx_Globals"
,
utility_code
=
globals_utility_code
))
# Builtin types
# Builtin types
# bool
# bool
# buffer
# buffer
...
...
Cython/Compiler/CmdLine.py
View file @
ba0b915f
...
@@ -137,6 +137,8 @@ def parse_command_line(args):
...
@@ -137,6 +137,8 @@ def parse_command_line(args):
options
.
compiler_directives
.
update
(
Options
.
extra_warnings
)
options
.
compiler_directives
.
update
(
Options
.
extra_warnings
)
elif
option
==
"--disable-function-redefinition"
:
elif
option
==
"--disable-function-redefinition"
:
Options
.
disable_function_redefinition
=
True
Options
.
disable_function_redefinition
=
True
elif
option
==
"--old-style-globals"
:
Options
.
old_style_globals
=
True
elif
option
==
"--directive"
or
option
.
startswith
(
'-X'
):
elif
option
==
"--directive"
or
option
.
startswith
(
'-X'
):
if
option
.
startswith
(
'-X'
)
and
option
[
2
:].
strip
():
if
option
.
startswith
(
'-X'
)
and
option
[
2
:].
strip
():
x_args
=
option
[
2
:]
x_args
=
option
[
2
:]
...
...
Cython/Compiler/Options.py
View file @
ba0b915f
...
@@ -59,6 +59,10 @@ embed = None
...
@@ -59,6 +59,10 @@ embed = None
# module creation time. For legacy code only, needed for some circular imports.
# module creation time. For legacy code only, needed for some circular imports.
disable_function_redefinition
=
False
disable_function_redefinition
=
False
# In previous iterations of Cython, globals() gave the first non-Cython module
# globals in the call stack. Sage relies on this behavior for variable injection.
old_style_globals
=
False
# Declare compiler directives
# Declare compiler directives
directive_defaults
=
{
directive_defaults
=
{
...
...
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