Does anyone know how I can test if an object's type is a builtin type or a user defined type ?
Gribouillis 1,391 Programming Explorer Team Colleague
Recommended Answers
Jump to PostDoes anyone know how I can test if an object's type is a builtin type or a user defined type ?
If it's not builtin, it must be imported from another module.
>>> getattr(list, '__module__') '__builtin__' >>>
All 2 Replies
bvdet 75 Junior Poster
Gribouillis commented: good idea +2
Gribouillis 1,391 Programming Explorer Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.