Skip to content

Commit

Permalink
Backport PR pandas-dev#60197: TYP/COMPAT: don't use Literal for Serie…
Browse files Browse the repository at this point in the history
…s.ndim to avoid tab completion bug in IPython
  • Loading branch information
jorisvandenbossche authored and meeseeksmachine committed Nov 5, 2024
1 parent a53604d commit 92232a1
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 92232a1

Please sign in to comment.