Skip to content
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion knack/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,12 @@ def update_argument(self, param_name, argtype):
# that coincides with the default
if isinstance(arg_default, str):
arg_default = DefaultStr(arg_default)
elif isinstance(arg_default, int):
elif type(arg_default) is int: # pylint: disable=unidiomatic-typecheck
Comment thread
AllyW marked this conversation as resolved.
Outdated
# use type here is because:
# 1) bool is subclass of int so isinstance(True, int) cannot distinguish between int and bool
# 2) bool is not extendable according to
# https://stackoverflow.com/questions/2172189/why-i-cant-extend-bool-in-python,
# so bool's is_default is ignored for now
arg_default = DefaultInt(arg_default)
# update the default
if arg_default:
Expand Down