diff options
| author | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2014-02-22 21:56:46 +0000 |
|---|---|---|
| committer | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2014-02-22 23:01:02 +0000 |
| commit | 212f4e353835b8717f99e2090286e8d68f306f42 (patch) | |
| tree | add60e39e3f934c9894e017dcd7fa18be4e894da /doc/src | |
| parent | 8937c635df2699c7869911764dd079d8fdd3d4ca (diff) | |
| download | psycopg2-212f4e353835b8717f99e2090286e8d68f306f42.tar.gz | |
Docs wordsmithing about Range order
Diffstat (limited to 'doc/src')
| -rw-r--r-- | doc/src/extras.rst | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/doc/src/extras.rst b/doc/src/extras.rst index 52a7056..7fab338 100644 --- a/doc/src/extras.rst +++ b/doc/src/extras.rst @@ -437,14 +437,17 @@ user-defined |range| types can be adapted using `register_range()`. `!Range` objects are immutable, hashable, and support the ``in`` operator (checking if an element is within the range). They can be tested for - equivalence. Empty ranges evaluate to `!False` in - boolean context, nonempty evaluate to `!True`. - - `!Range` objects can be sorted although, as on the server-side, - this ordering is not particularly meangingful. + equivalence. Empty ranges evaluate to `!False` in boolean context, + nonempty evaluate to `!True`. .. versionchanged:: 2.5.3 + `!Range` objects can be sorted although, as on the server-side, this + ordering is not particularly meangingful. It is only meant to be used + by programs assuming objects using `!Range` as primary key can be + sorted on them. In previous versions comparing `!Range`\s raises + `!TypeError`. + Although it is possible to instantiate `!Range` objects, the class doesn't have an adapter registered, so you cannot normally pass these instances as query arguments. To use range objects as query arguments you can either |
