rigetti / rpcq

The RPC framework and message specification for @rigetti Quantum Cloud Services.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Setting a default of nil has unexpected behavior for boolean types when generating python bindings

stephanbro opened this issue · comments

Code can describe this better than I can.
Message definition:

     (|relay_closed|
      :documentation "Set the state of the Flux relay.\
          True  - Relay closed, allows flux current to flow.\
          False - Relay open, no flux current can flow."
      :type :bool
      :required nil,
      :default nil))

Generated python bindings:

    relay_closed: Optional[bool] = False
    """Set the state of the Flux relay.
          True  - Relay closed, allows flux current to flow.
          False - Relay open, no flux current can flow."""

My desired behavior would change relay_closed: Optional[bool] = False to be relay_closed: Optional[bool] = None

Fixed by #136