commit | 5617b310c61fbb91fab90c9eb3529aa20e728fd4 | [log] [tgz] |
---|---|---|
author | Abseil Team <absl-team@google.com> | Tue Jun 09 11:09:35 2020 -0700 |
committer | Copybara-Service <copybara-worker@google.com> | Tue Jun 09 11:10:29 2020 -0700 |
tree | 76d3118f05952693c5fe44a9669ee41bb34145d5 | |
parent | 154871c8a0b97ba1dcc86686a45e718a38bc4747 [diff] |
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
This repository is a collection of Python library code for building Python applications. The code is collected from Google's own Python code base, and has been extensively tested and used in production.
To install the package, simply run:
pip install absl-py
Or install from source:
python setup.py install
To run Abseil tests, you can clone the git repo and run bazel:
git clone https://github.com/abseil/abseil-py.git cd abseil-py bazel test absl/...
Please refer to smoke_tests/sample_app.py as an example to get started.
See the Abseil Python Developer Guide.
The current repository includes an initial set of libraries for early adoption. More components and interoperability with Abseil C++ Common Libraries will come in future releases.
The Abseil Python library is licensed under the terms of the Apache license. See LICENSE for more information.