Skip to content

Commit

Permalink
Make empty object marker private
Browse files Browse the repository at this point in the history
  • Loading branch information
nickdrozd committed Nov 26, 2022
1 parent d78ea09 commit a8d26dd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion astroid/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ class Context(enum.Enum):
BRAIN_MODULES_DIRECTORY = ASTROID_INSTALL_DIRECTORY / "brain"


EMPTY_OBJECT_MARKER = object()
_EMPTY_OBJECT_MARKER = object()
4 changes: 2 additions & 2 deletions astroid/nodes/node_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

from astroid import decorators, util
from astroid.bases import Instance, _infer_stmts
from astroid.const import EMPTY_OBJECT_MARKER, Context
from astroid.const import _EMPTY_OBJECT_MARKER, Context
from astroid.context import InferenceContext
from astroid.exceptions import (
AstroidIndexError,
Expand Down Expand Up @@ -2551,7 +2551,7 @@ class EmptyNode(_base_nodes.NoChildrenNode):
object = None

def has_underlying_object(self) -> bool:
return self.object is not None and self.object is not EMPTY_OBJECT_MARKER
return self.object is not None and self.object is not _EMPTY_OBJECT_MARKER


class ExceptHandler(
Expand Down
4 changes: 2 additions & 2 deletions astroid/raw_building.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from typing import Any, Union

from astroid import bases, nodes
from astroid.const import EMPTY_OBJECT_MARKER, IS_PYPY
from astroid.const import _EMPTY_OBJECT_MARKER, IS_PYPY
from astroid.manager import AstroidManager
from astroid.nodes import node_classes

Expand Down Expand Up @@ -55,7 +55,7 @@ def _add_dunder_class(func, member) -> None:
func.instance_attrs["__class__"] = [ast_klass]


def attach_dummy_node(node, name: str, runtime_object=EMPTY_OBJECT_MARKER) -> None:
def attach_dummy_node(node, name: str, runtime_object=_EMPTY_OBJECT_MARKER) -> None:
"""create a dummy node and register it in the locals of the given
node with the specified name
"""
Expand Down

0 comments on commit a8d26dd

Please sign in to comment.