On Jan 15, 1:08 pm, Duncan Booth <[email protected]> wrote: > Carl Banks <[email protected]> wrote: > > I don't see what the big deal is. Right now isinstance accepts a type > > or a tuple of types. The code could be changed to allow a type, or > > any iterable the returns types (wherein every items of the sequence is > > required to be a type). What's messy about that? > > No, it isn't restricted to a type or a tuple of types: right now isinstance > accepts X where X is a type or a tuple of X. The definition is recursive, > and the data structure can be deeply nested, but (because tuples are > immutable) it cannot be infinite. > > e.g.>>> isinstance('x', (((((int, (float, str)),),),),)) > > True
Oh. Not sure what the use case for THAT was, but that would make things messy. Carl Banks -- http://mail.python.org/mailman/listinfo/python-list
