8000 Discussion: Conditional assignment · Issue #434 · evhub/coconut · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Discussion: Conditional assignment #434
Closed
@ArneBachmann

Description

@ArneBachmann

We probably already discussed this, but I really would like to do conditional assignment:

(a if predicate else b) = expression

Not sure how this can be parsed unambiguously, but it is easy to transpile to pure Python:

if predicate:
  a = expression
else:
  b = expression

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0