This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author paul.j3
Recipients Gharg, paul.j3, remi.lapeyre, rhettinger
Date 2020-04-16.20:23:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1587068607.83.0.669170309799.issue40303@roundup.psfhosted.org>
In-reply-to
Content
'type=bool' doesn't get any special treatment.  'bool' is a builtin Python function.

test with 

    def mybool(astr):
        print("mybool:", astr, len(astr), bool(astr))
        return bool(astr)

The trick to getting a False value is to pass a genuinely empty string.

As can be seen in several previous bug/issues, 'bool' is allowed as a type function, but since the only string that returns False is the empty one, it isn't very useful.  And we've resisted attempts give it some special treatment.

Users can write their own 'type' function that accepts language specific 'true/false' words.  Otherwise we encourage the use of 'store_true', 'store_false' action values.
History
Date User Action Args
2020-04-16 20:23:27paul.j3setrecipients: + paul.j3, rhettinger, remi.lapeyre, Gharg
2020-04-16 20:23:27paul.j3setmessageid: <1587068607.83.0.669170309799.issue40303@roundup.psfhosted.org>
2020-04-16 20:23:27paul.j3linkissue40303 messages
2020-04-16 20:23:27paul.j3create