brettviren / moo

ruminants on module oriented programming
GNU General Public License v3.0
4 stars 4 forks source link

`moo.otypes` produces broken code when record field of type string has empty string as a default #10

Closed brettviren closed 3 years ago

brettviren commented 3 years ago

When a moo.otypes class with such a default field is instantiated get an error like:

>       code = compile(source, "<{schema} {name}>".format(**ost), "exec")
E         File "<record Thing>", line 10
E           def __init__(self, *args, name:test.issue10.Name = ):
E                                                              ^
E       SyntaxError: invalid syntax

Adding test: test_moo_otypes.py:test_issue10()