-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
atdpy: fix handling of fields defaulting to the empty list #339
Labels
Comments
mjambon
added a commit
to semgrep/semgrep-interfaces
that referenced
this issue
May 4, 2023
This was referenced May 4, 2023
The solution may be to emit |
mjambon
added a commit
that referenced
this issue
May 11, 2023
sharing the same physical value across all objects of the same class. Fixes #339
3 tasks
mjambon
added a commit
to mjambon/opam-repository
that referenced
this issue
May 12, 2023
…n-codec-runtime and atd (2.12.0) CHANGES: * atdgen: Annotate generated code with types to disambiguate OCaml classic variants (ahrefs/atd#331) * atdpy: Support the option type more correctly so that it follows ATD's convention for JSON encoding. This allows compatibility with JSON produced by other tools of the ATD suite. The Python type, however, is still a nullable (`Optional`) to make things simpler for Python programmers. This prevents distinguishing `["Some", "None"]` from `"None"` which both translate to `None` in Python. (ahrefs/atd#332) * (BREAKING) atdgen: revert default encoding of int64 values as string (ahrefs/atd#330) * atdgen: Support `<json repr="string">` for `int` values (ahrefs/atd#330) * atdpy: Treat default field values as expressions to evaluate each time they're assigned to a field. This allows the use of mutable defaults such as lists (ahrefs/atd#339)
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
results in incorrect Python code in atdpy 2.11.0:
items: List[int]
the JSON writer doesn't check that the list is notNone
:res['items'] = _atd_write_list(_atd_write_int)(self.items)
Update: having the
None
value where a list was expected was a bug in a user program where typechecking by mypy had been bypassed. However, the issue of the mutability of[]
still had to be addressed.The text was updated successfully, but these errors were encountered: