aboutsummaryrefslogtreecommitdiff
path: root/absl/testing
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2020-06-09 11:09:35 -0700
committerCopybara-Service <copybara-worker@google.com>2020-06-09 11:10:29 -0700
commit5617b310c61fbb91fab90c9eb3529aa20e728fd4 (patch)
tree76d3118f05952693c5fe44a9669ee41bb34145d5 /absl/testing
parent154871c8a0b97ba1dcc86686a45e718a38bc4747 (diff)
downloadabsl-py-5617b310c61fbb91fab90c9eb3529aa20e728fd4.tar.gz
The generic parameter of FlagHolder now represents the type of value().
(a) For a flag with default None, define_* will return a FlagHolder[Optional[T]] (b) For a flag with default != None, define_* will return a FlagHolder[T] When we are unable to express "default != None", we always return FlagHolder[Optional[T]] This assumes that the type of default() and value() will be the same. This assumption holds, till we want the type system to understand that a "required" flag with a None default cannot return a None value. Changes: - When exact types for default is known, add @overloads for the DEFINE_* methods for the None case and remaining cases. - When exact types for default is now known, change return type to FlagHolder[Optional[T]] -- which has same semantics of what FlagHolder[T] used to have. PiperOrigin-RevId: 315519341 Change-Id: I88dc63b3c5271e12f3274b7246eb602b91b84caf
Diffstat (limited to 'absl/testing')
0 files changed, 0 insertions, 0 deletions