summaryrefslogtreecommitdiff
path: root/astroid/objects.py
diff options
context:
space:
mode:
authorPierre Sassoulas <pierre.sassoulas@gmail.com>2021-08-18 23:04:14 +0200
committerPierre Sassoulas <pierre.sassoulas@gmail.com>2021-08-18 23:17:45 +0200
commit44fc1e1e23fd1d3b43cf80a10eb1c032a4312a2b (patch)
tree5c6c2ad5028be821b72fdbda71160fe22b93f0e3 /astroid/objects.py
parent76036144e4b0049575d5c2f0c64d6365529ee9e7 (diff)
downloadastroid-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.py7
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")