pyjaco icon indicating copy to clipboard operation
pyjaco copied to clipboard

Pyjaco version on pyjaco.org is outdated (was: Compiler doesn't construct a dict in the right manner)

Open obeleh opened this issue 11 years ago • 3 comments

Example code:

def createDict(key, value): return {key: value}

if str(createDict("k", "v")) != "{'k': 'v'}": raise Exception("Dict wrong")

The result is: {'key': 'v'} And it should be: {'k': 'v'}

obeleh avatar Nov 26 '12 10:11 obeleh

I can't replicate this with the master branch

I use a modified test case:

def createDict(key, value):
  return {key: value}

v = createDict("k", "v")
if str(v) != "{'k': 'v'}":
  raise Exception("Dict wrong")
else:
  print v

Both python and pyjaco produce this:

{'k': 'v'}

Can you check if you are using the newest release? If it's still a problem, can you please send the generated code? Let me know if you need any help with this.

chrivers avatar Nov 26 '12 12:11 chrivers

I used the tanslator on the website

obeleh avatar Nov 26 '12 18:11 obeleh

Thank you for that info. I updated the description accordingly :)

chrivers avatar Nov 28 '12 12:11 chrivers