JunJun
JunJun

Reputation: 55

jython 2.7.2 getting syntax error when adding datatype to parameter

using this: def func(self, d:str): pass

results in this error:

SyntaxError: mismatched input ':' expecting RPAREN

how to fix that?

Upvotes: 0

Views: 296

Answers (1)

JunJun
JunJun

Reputation: 55

I think I found the problem. Jython 2.7.2 uses python 2.7. this syntax above is python 3+ syntax. so it doesn't work.

Upvotes: 1

Related Questions