benjaminp / six

Python 2 and 3 compatibility library
https://six.readthedocs.io/
MIT License
987 stars 274 forks source link

Not sure if six can help? (types.InstanceTypes) #330

Closed bschollnick closed 4 years ago

bschollnick commented 4 years ago

Folks,

I'm trying to port some Py2 code to Py3, and I'm not sure that six can help with this....

ReturnList = []
    #------------------------------------
    # Return [] if Object not an Instance
    #------------------------------------

    # If the passed Object isn't an instance (object) then we return the empty
    # Return List that we defined above. This is an error check to prevent
    # a class from being passed. This function will fail if a class were passed
    # to it.

    if type(Object)!=types.InstanceType: return ReturnList

Is there some six functionality that can help move this to py3? I haven't been able to find anything in the docs, that appears to be equivalent?