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/nodes/node_classes.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/nodes/node_classes.py')
-rw-r--r-- | astroid/nodes/node_classes.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/astroid/nodes/node_classes.py b/astroid/nodes/node_classes.py index 1523707a..53bb62e1 100644 --- a/astroid/nodes/node_classes.py +++ b/astroid/nodes/node_classes.py @@ -45,7 +45,7 @@ from typing import Callable, Generator, Optional from astroid import bases from astroid import context as contextmod from astroid import decorators, mixins, util -from astroid.const import BUILTINS, Context +from astroid.const import Context from astroid.exceptions import ( AstroidIndexError, AstroidTypeError, @@ -2191,7 +2191,7 @@ class Dict(NodeNG, bases.Instance): :returns: The name of the type. :rtype: str """ - return "%s.dict" % BUILTINS + return "builtins.dict" def get_children(self): """Get the key and value nodes below this node. @@ -3083,7 +3083,7 @@ class List(BaseContainer): :returns: The name of the type. :rtype: str """ - return "%s.list" % BUILTINS + return "builtins.list" def getitem(self, index, context=None): """Get an item from this node. @@ -3278,7 +3278,7 @@ class Set(BaseContainer): :returns: The name of the type. :rtype: str """ - return "%s.set" % BUILTINS + return "builtins.set" class Slice(NodeNG): @@ -3356,7 +3356,7 @@ class Slice(NodeNG): :returns: The name of the type. :rtype: str """ - return "%s.slice" % BUILTINS + return "builtins.slice" def igetattr(self, attrname, context=None): """Infer the possible values of the given attribute on the slice. @@ -3710,7 +3710,7 @@ class Tuple(BaseContainer): :returns: The name of the type. :rtype: str """ - return "%s.tuple" % BUILTINS + return "builtins.tuple" def getitem(self, index, context=None): """Get an item from this node. |