isinstance()

Jon Ribbens jon+usenet at unequivocal.eu
Wed Aug 2 19:38:10 EDT 2023


On 2023年08月02日, dn <PythonList at DancesWithMice.info> wrote:
> Can you please explain why a multi-part second-argument must be a tuple 
> and not any other form of collection-type?

The following comment may hold a clue:
 if (PyTuple_Check(cls)) {
 /* Not a general sequence -- that opens up the road to
 recursion and stack overflow. */
https://github.com/python/cpython/blob/main/Objects/abstract.c#L2684
Plus an almost total lack of demand for change I should think.


More information about the Python-list mailing list

AltStyle によって変換されたページ (->オリジナル) /