diff options
author | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2021-08-18 23:04:14 +0200 |
---|---|---|
committer | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2021-08-18 23:17:45 +0200 |
commit | 44fc1e1e23fd1d3b43cf80a10eb1c032a4312a2b (patch) | |
tree | 5c6c2ad5028be821b72fdbda71160fe22b93f0e3 /astroid/objects.py | |
parent | 76036144e4b0049575d5c2f0c64d6365529ee9e7 (diff) | |
download | astroid-git-builtin-simplified.tar.gz |
Replace the constant BUILTINS by the string 'builtins'builtin-simplified
This make for clearer and also sligtly faster code (means time
seems to decrese by 0.68% with this change alone (astroid/pylint)
in the pylint tests benchmarks). Done because we were using an
import from astroid from astroid.bases for one of those, which is
kinda messy.
Diffstat (limited to 'astroid/objects.py')
-rw-r--r-- | astroid/objects.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/astroid/objects.py b/astroid/objects.py index b26a5dd5..4241c170 100644 --- a/astroid/objects.py +++ b/astroid/objects.py @@ -23,7 +23,6 @@ leads to an inferred FrozenSet: from astroid import bases, decorators, util -from astroid.const import BUILTINS from astroid.exceptions import ( AttributeInferenceError, InferenceError, @@ -40,7 +39,7 @@ class FrozenSet(node_classes.BaseContainer): """class representing a FrozenSet composite node""" def pytype(self): - return "%s.frozenset" % BUILTINS + return "builtins.frozenset" def _infer(self, context=None): yield self @@ -120,7 +119,7 @@ class Super(node_classes.NodeNG): return ast_builtins.getattr("super")[0] def pytype(self): - return "%s.super" % BUILTINS + return "builtins.super" def display_type(self): return "Super of" @@ -307,7 +306,7 @@ class Property(scoped_nodes.FunctionDef): type = "property" def pytype(self): - return "%s.property" % BUILTINS + return "builtins.property" def infer_call_result(self, caller=None, context=None): raise InferenceError("Properties are not callable") |