Skip to content

Don't allow boolean operators on reactive variables #782

@maartenbreddels

Description

@maartenbreddels

Very often, i use

some_var = solara.reactive(0)

if some_var: # OOPS, forgot .value
  ...

I don't think there is a reason to do reactive equals comparison, and I think we should error on that. If you want to know if it is the same object, use is, and otherwise compare .value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    footgunCommon ways to shoot yourself in the foot

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions