You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we can define a boolean flag with default value to None:
FLAGS = gflags.FLAGS
gflags.DEFINE_boolean("the_flag", None, "The flag.")
I'm not sure if this is expected or should it be allowed, since python-gflags
project tries to mimic the C++ version of gflags as close as possible. This is
troublesome because user may be unaware that a boolean flag can fail both of
the following assertions:
assertTrue(FLAGS.the_flag) # AssertionError: None is not True
assertFalse(FLAGS.the_flag) # AssertionError: None is not False
Original issue reported on code.google.com by linshu...@chromium.org on 4 Apr 2012 at 8:04
The text was updated successfully, but these errors were encountered:
Sorry for the late reply -- I'm not really the right person to speak to this
for several reasons. Besides not being the project maintainer anymore, I also
don't know what the best thing to do is. I agree it makes sense that a flag of
type boolean should have type bool(), which None doesn't, but I don't know if
it's reasonable to change the API at this point.
Original comment by csilv...@gmail.com on 20 Apr 2012 at 1:32
Original issue reported on code.google.com by
linshu...@chromium.org
on 4 Apr 2012 at 8:04The text was updated successfully, but these errors were encountered: