Closed AllyW closed 1 year ago
in this pr: https://github.com/Azure/azure-cli/pull/26819 aaz cmd:
before: after:
As a side note, https://github.com/Azure/azure-cli/pull/16081 took a different approach. It sets the default value of role
to None
and defaulting it to Contributor
manually in custom.py
's code.
The C source code of bool
also mentions:
The class bool is a subclass of the class int, and cannot be subclassed.
An alternative is to consider developing our own Bool
and implementing special methods such as __bool__
, __str__
, so that it acts like a real bool
, and also bears additional attribute is_default
.
bool
is subclass of int, while defaultTrue
orFalse
should not be converted into int1
or0
. Otherwise, type check would fail foraaz
cmds (https://github.com/Azure/azure-cli/blob/58ac6ab07fa850e1a6458dec87af91cd6725069e/src/azure-cli-core/azure/cli/core/aaz/_field_type.py#L47)