Can I modify the type of an object in python -
specifically want change stringtype nonetype. know how use int() , str() convert between inttype , stringtype, can't find similar solution nonetype. there simpler solution besides using built in functions int , str?
sorry ambiguous, have program enters string 'print("check")' python shell , need converted function. assumed because functions have type nonetype converting string nonetype make usable. ideas?
eval() works purposes cairnarvon, thanks!
you can trivially define own function this:
def none(*args): """converts arguments none.""" return none but that's pretty pointless. use literal none whenever need one.
as clarification, you're looking eval or ast module, though should consider you're hoping accomplish; eval, in particular, create more problems solve.
Comments
Post a Comment