Skip to content

Commit 92a0c81

Browse files
Backport PR #60197 on branch 2.3.x (TYP/COMPAT: don't use Literal for Series.ndim to avoid tab completion bug in IPython) (#60200)
Backport PR #60197: TYP/COMPAT: don't use Literal for Series.ndim to avoid tab completion bug in IPython Co-authored-by: Joris Van den Bossche <[email protected]>
1 parent a53604d commit 92a0c81

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pandas/core/base.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,11 @@ def __len__(self) -> int:
361361
# We need this defined here for mypy
362362
raise AbstractMethodError(self)
363363

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

0 commit comments

Comments
 (0)