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
17111fa7
Commit
17111fa7
authored
Oct 06, 2010
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get rid of unused __get__/__set__ warnings for cimported classes.
parent
e0814f76
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
17 deletions
+16
-17
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+1
-5
Cython/Compiler/ParseTreeTransforms.py
Cython/Compiler/ParseTreeTransforms.py
+15
-12
No files found.
Cython/Compiler/Nodes.py
View file @
17111fa7
...
@@ -899,13 +899,11 @@ class CVarDefNode(StatNode):
...
@@ -899,13 +899,11 @@ class CVarDefNode(StatNode):
# declarators [CDeclaratorNode]
# declarators [CDeclaratorNode]
# in_pxd boolean
# in_pxd boolean
# api boolean
# api boolean
# properties [entry]
# decorators [cython.locals(...)] or None
# decorators [cython.locals(...)] or None
# directive_locals { string : NameNode } locals defined by cython.locals(...)
# directive_locals { string : NameNode } locals defined by cython.locals(...)
child_attrs
=
[
"base_type"
,
"declarators"
]
child_attrs
=
[
"base_type"
,
"declarators"
]
properties
=
()
decorators
=
None
decorators
=
None
directive_locals
=
{}
directive_locals
=
{}
...
@@ -921,7 +919,6 @@ class CVarDefNode(StatNode):
...
@@ -921,7 +919,6 @@ class CVarDefNode(StatNode):
# a property; made in AnalyseDeclarationsTransform).
# a property; made in AnalyseDeclarationsTransform).
if
(
dest_scope
.
is_c_class_scope
if
(
dest_scope
.
is_c_class_scope
and
self
.
visibility
in
(
'public'
,
'readonly'
)):
and
self
.
visibility
in
(
'public'
,
'readonly'
)):
self
.
properties
=
[]
need_property
=
True
need_property
=
True
else
:
else
:
need_property
=
False
need_property
=
False
...
@@ -955,8 +952,7 @@ class CVarDefNode(StatNode):
...
@@ -955,8 +952,7 @@ class CVarDefNode(StatNode):
"Only 'extern' C variable declaration allowed in .pxd file"
)
"Only 'extern' C variable declaration allowed in .pxd file"
)
entry
=
dest_scope
.
declare_var
(
name
,
type
,
declarator
.
pos
,
entry
=
dest_scope
.
declare_var
(
name
,
type
,
declarator
.
pos
,
cname
=
cname
,
visibility
=
visibility
,
is_cdef
=
1
)
cname
=
cname
,
visibility
=
visibility
,
is_cdef
=
1
)
if
need_property
:
entry
.
needs_property
=
need_property
self
.
properties
.
append
(
entry
)
class
CStructOrUnionDefNode
(
StatNode
):
class
CStructOrUnionDefNode
(
StatNode
):
...
...
Cython/Compiler/ParseTreeTransforms.py
View file @
17111fa7
...
@@ -1018,6 +1018,20 @@ property NAME:
...
@@ -1018,6 +1018,20 @@ property NAME:
self
.
visitchildren
(
node
)
self
.
visitchildren
(
node
)
self
.
env_stack
.
pop
()
self
.
env_stack
.
pop
()
return
node
return
node
def
visit_CClassDefNode
(
self
,
node
):
node
=
self
.
visit_ClassDefNode
(
node
)
if
node
.
scope
and
node
.
scope
.
implemented
:
stats
=
[]
for
entry
in
node
.
scope
.
var_entries
:
if
entry
.
needs_property
:
property
=
self
.
create_Property
(
entry
)
property
.
analyse_declarations
(
node
.
scope
)
self
.
visit
(
property
)
stats
.
append
(
property
)
if
stats
:
node
.
body
.
stats
+=
stats
return
node
def
visit_FuncDefNode
(
self
,
node
):
def
visit_FuncDefNode
(
self
,
node
):
self
.
seen_vars_stack
.
append
(
set
())
self
.
seen_vars_stack
.
append
(
set
())
...
@@ -1093,20 +1107,9 @@ property NAME:
...
@@ -1093,20 +1107,9 @@ property NAME:
return
node
return
node
def
visit_CVarDefNode
(
self
,
node
):
def
visit_CVarDefNode
(
self
,
node
):
# to ensure all CNameDeclaratorNodes are visited.
# to ensure all CNameDeclaratorNodes are visited.
self
.
visitchildren
(
node
)
self
.
visitchildren
(
node
)
return
None
if
node
.
properties
:
stats
=
[]
for
entry
in
node
.
properties
:
property
=
self
.
create_Property
(
entry
)
property
.
analyse_declarations
(
node
.
dest_scope
)
self
.
visit
(
property
)
stats
.
append
(
property
)
return
StatListNode
(
pos
=
node
.
pos
,
stats
=
stats
)
else
:
return
None
def
create_Property
(
self
,
entry
):
def
create_Property
(
self
,
entry
):
if
entry
.
visibility
==
'public'
:
if
entry
.
visibility
==
'public'
:
...
...
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