Use datetime in pythran

331 views Asked by At

I'm working with pythran, a Python to c++ compiler http://pythran.readthedocs.io/

Can we use datetime or any other way to use in pythran function a date or a time info ?:

from datetime import datetime
print datetime.now()

I get:

$ pythran ccompile.py 
ccompile.py None None
CRITICAL I am in trouble. Your input file does not seem to match    
Pythran's constraints...
E: Attribute 'now' unknown (ccompile.py, line 13)
1

There are 1 answers

0
serge-sans-paille On BEST ANSWER

The datetime module is not supported by pythran, as can be deduced from the error message. Workarounds are:

  • call datetime from the python code and pass the result to the pythranized function
  • fill an issue on the github page of the project.