summaryrefslogtreecommitdiff
path: root/astroid/bases.py
diff options
context:
space:
mode:
Diffstat (limited to 'astroid/bases.py')
-rw-r--r--astroid/bases.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/astroid/bases.py b/astroid/bases.py
index 19c5039e..56f851f9 100644
--- a/astroid/bases.py
+++ b/astroid/bases.py
@@ -29,7 +29,7 @@ import collections
from astroid import context as contextmod
from astroid import decorators, util
-from astroid.const import BUILTINS, PY310_PLUS
+from astroid.const import PY310_PLUS
from astroid.exceptions import (
AstroidTypeError,
AttributeInferenceError,
@@ -45,7 +45,7 @@ manager = util.lazy_import("manager")
# TODO: check if needs special treatment
BOOL_SPECIAL_METHOD = "__bool__"
-PROPERTIES = {BUILTINS + ".property", "abc.abstractproperty"}
+PROPERTIES = {"builtins.property", "abc.abstractproperty"}
if PY310_PLUS:
PROPERTIES.add("enum.property")
@@ -94,7 +94,7 @@ def _is_property(meth, context=None):
if base_class.__class__.__name__ != "Name":
continue
module, _ = base_class.lookup(base_class.name)
- if module.name == BUILTINS and base_class.name == "property":
+ if module.name == "builtins" and base_class.name == "property":
return True
return False
@@ -394,7 +394,7 @@ class UnboundMethod(Proxy):
# instance of the class given as first argument.
if (
self._proxied.name == "__new__"
- and self._proxied.parent.frame().qname() == "%s.object" % BUILTINS
+ and self._proxied.parent.frame().qname() == "builtins.object"
):
if caller.args:
node_context = context.extra_context.get(caller.args[0])
@@ -445,7 +445,7 @@ class BoundMethod(UnboundMethod):
if mcs.__class__.__name__ != "ClassDef":
# Not a valid first argument.
return None
- if not mcs.is_subtype_of("%s.type" % BUILTINS):
+ if not mcs.is_subtype_of("builtins.type"):
# Not a valid metaclass.
return None
@@ -558,7 +558,7 @@ class Generator(BaseInstance):
return False
def pytype(self):
- return "%s.generator" % BUILTINS
+ return "builtins.generator"
def display_type(self):
return "Generator"
@@ -579,7 +579,7 @@ class AsyncGenerator(Generator):
"""Special node representing an async generator"""
def pytype(self):
- return "%s.async_generator" % BUILTINS
+ return "builtins.async_generator"
def display_type(self):
return "AsyncGenerator"