Skip to content

[Task] Decide whether Yaku.name should be required #112

@Apricot-S

Description

@Apricot-S

Summary

The Yaku class currently defines name as Optional[str].
The only place where name is directly referenced in the library is the Yaku.__str__() method, which returns self.name and therefore fails when name is None.

This issue discusses whether name should be made a required field.

Motivation

  • Yaku.__str__() assumes name is always a string
  • Making name required would prevent unexpected None errors
  • All built‑in Yaku subclasses already set name inside set_attributes()

Discussion points

  • Should name be required at the type level (str instead of Optional[str])?
  • If not required, should Yaku.__str__() provide a safe fallback (e.g., empty string or class name)?
  • Are there use cases for a nameless Yaku?

Breaking changes

If name becomes required, the following cases will break:

  • Instantiating a Yaku subclass without defining name
  • Assigning name = None after instantiation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions