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

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -