Skip to content

Commit

Permalink
TYP/COMPAT: don't use Literal for Series.ndim to avoid tab completion…
Browse files Browse the repository at this point in the history
… bug in IPython (#60197)
  • Loading branch information
jorisvandenbossche authored Nov 5, 2024
1 parent b84e0c8 commit e449b49
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pandas/core/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,11 @@ def __len__(self) -> int:
# We need this defined here for mypy
raise AbstractMethodError(self)

# Temporarily avoid using `-> Literal[1]:` because of an IPython (jedi) bug
# https://github.com/ipython/ipython/issues/14412
# https://github.com/davidhalter/jedi/issues/1990
@property
def ndim(self) -> Literal[1]:
def ndim(self) -> int:
"""
Number of dimensions of the underlying data, by definition 1.
Expand Down

0 comments on commit e449b49

Please sign in to comment.