3

When I use the type function, it returns me:

>>>print(type('string'))
<class 'str'>

class Test:
    pass
test_obj = Test()
>>>print(type(test_obj))
<class '__main__.Test'>

I'm just wondering whether it is possible for it to output str and Test only instead of '<class 'str'>' or <class '__main__.Test'>

user2864740
  • 60,010
  • 15
  • 145
  • 220

0 Answers0