Possible cleanup of "Options" boilerplate #402
No reviewers
Labels
No Label
bug
documentation
duplicate
enhancement
feature
good first issue
help wanted
in progress
invalid
question
wontfix
Copied from Github
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cerc-io/stack-orchestrator#402
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "erikdies/cli_ergonomics_alternatives"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Maybe this is a little cleaner using dataclasses?
The dataclass decorator is doing the same thing you are here with
__init__
, but also adds__repr__
and__eq__
by default. The args can be passed positionally or as kwargs by default, with a kwargs only option. The dataclass also allows for some nice things like setting defaults that would be challenging with regular classes.re: https://docs.python.org/3/library/dataclasses.html
You can also get some features that might be desirable (not used in this PR), like fake immutability using the kwarg "frozen"
Setting defaults here is not needed, just done to match the defaults in the CLI tooling to replicate defaults for repl use.
Thanks!