Skip to content
This repository was archived by the owner on Nov 7, 2024. It is now read-only.
This repository was archived by the owner on Nov 7, 2024. It is now read-only.

Unsafe "None" checking #443

@MichaelMarien

Description

@MichaelMarien

Throughout the library, a lot of initialisation check if an input is provided and compare it to the default value None. However usually this code looks like (example):


  def __init__(self,
                     rank: int,
                     ...
                     backend: Optional[Text] = None,
    ...
    if not backend:
      backend = `config.default_backend

Values like False,[], 0,... actually pass this test. A better way of testing is if backend is not None.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions