Pandas version checks

  • [x] I have checked that this issue has not already been reported.

  • [x] I have confirmed this bug exists on the latest version of pandas.

  • [x] I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

>>> import pandas as pd
>>> ind=pd.Index([["str", "rts"]])
>>> ind
Index([['str', 'rts']], dtype='object')

Issue Description

It seems that Index accepts a list of list of strings, but that's not hashable, and docs say that we only accept hashable values in an Index.

Expected Behavior

This should be rejected during construction.

Installed Versions

INSTALLED VERSIONS ------------------ commit : 2cc37625532045f4ac55b27176454bbbc9baf213 python : 3.10.14 python-bits : 64 OS : Windows OS-release : 10 Version : 10.0.26100 machine : AMD64 processor : Intel64 Family 6 Model 183 Stepping 1, GenuineIntel byteorder : little LC_ALL : None LANG : None LOCALE : English_United States.1252 pandas : 2.3.0 numpy : 2.2.6 pytz : 2025.2 dateutil : 2.9.0.post0 pip : 24.2 Cython : None sphinx : None IPython : None adbc-driver-postgresql: None adbc-driver-sqlite : None bs4 : 4.13.4 blosc : None bottleneck : None dataframe-api-compat : None fastparquet : None fsspec : None html5lib : 1.1 hypothesis : None gcsfs : None jinja2 : 3.1.6 lxml.etree : 6.0.0 matplotlib : 3.10.3 numba : None numexpr : 2.11.0 odfpy : None openpyxl : 3.1.5 pandas_gbq : None psycopg2 : None pymysql : None pyarrow : 20.0.0 pyreadstat : 1.3.0 pytest : 8.4.1 python-calamine : None pyxlsb : 1.0.10 s3fs : None scipy : 1.15.3 sqlalchemy : 2.0.41 tables : 3.10.1 tabulate : 0.9.0 xarray : 2025.6.1 xlrd : 2.0.2 xlsxwriter : 3.2.5 zstandard : None tzdata : 2025.2 qtpy : None pyqt5 : None

Comment From: UzmaYounas794

In the Index constructor ( new in pandas/core/indexes/base.py), we can validate each element by checking if it’s hashable using hash(item). This is where the Index is first constructed from user input.

Comment From: mroeschke

Index has always been special at accepting non-Python-hashable values since I think the khash indexing engine is able to hash more Python objects than just hash. Although it's an antipattern to store nested objects like this in an Index not sure if we should ban it

Comment From: Dr-Irv

Except at https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Index.html#pandas.Index we say "An Index instance can only contain hashable objects."

Comment From: jbrockmendel

xref #20285