I have a problem that seems very ungooglable.
There is a compile
function in Python.
c = compile('6', 'ff', 'exec')
The result of this is a class named code
.
>>> c.__class__
<class 'code'>
I wanted to make a comprison to detect a type, but I can't find a module with this class. Naturally I could code it like this:
if type(unknown_object) == some_codeobj.__class__:
But it's not very elegant. Does anyone knows, where I can find the class?
Aucun commentaire:
Enregistrer un commentaire