Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pymbolic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andreas Klöckner
pymbolic
Commits
4bf3d389
Commit
4bf3d389
authored
2 years ago
by
Kaushik Kulkarni
Committed by
Andreas Klöckner
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
do not rewrite properties
parent
fd199ccd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#358929
passed
2 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pymbolic/mapper/optimize.py
+5
-1
5 additions, 1 deletion
pymbolic/mapper/optimize.py
with
5 additions
and
1 deletion
pymbolic/mapper/optimize.py
+
5
−
1
View file @
4bf3d389
...
@@ -21,7 +21,7 @@ THE SOFTWARE.
...
@@ -21,7 +21,7 @@ THE SOFTWARE.
"""
"""
import
ast
import
ast
from
functools
import
lru_cache
from
functools
import
lru_cache
,
cached_property
# This machinery applies AST rewriting to the mapper in a mildly brutal
# This machinery applies AST rewriting to the mapper in a mildly brutal
...
@@ -270,6 +270,10 @@ def optimize_mapper(
...
@@ -270,6 +270,10 @@ def optimize_mapper(
for
name
in
dir
(
cls
):
for
name
in
dir
(
cls
):
if
not
name
.
startswith
(
"
__
"
)
or
name
==
"
__call__
"
:
if
not
name
.
startswith
(
"
__
"
)
or
name
==
"
__call__
"
:
method
=
getattr
(
cls
,
name
)
method
=
getattr
(
cls
,
name
)
if
isinstance
(
method
,
(
property
,
cached_property
)):
# properties don't have *args, **kwargs
continue
seen_module_names
.
add
(
method
.
__module__
)
seen_module_names
.
add
(
method
.
__module__
)
method_ast
=
_get_ast_for_method
(
method
)
method_ast
=
_get_ast_for_method
(
method
)
if
name
!=
method_ast
.
name
:
if
name
!=
method_ast
.
name
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment