xtquant.xtbson.bson36.max_key

Representation for the MongoDB internal MaxKey type.

 1# Copyright 2010-present MongoDB, Inc.
 2#
 3# Licensed under the Apache License, Version 2.0 (the "License");
 4# you may not use this file except in compliance with the License.
 5# You may obtain a copy of the License at
 6#
 7# http://www.apache.org/licenses/LICENSE-2.0
 8#
 9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15"""Representation for the MongoDB internal MaxKey type.
16"""
17
18
19class MaxKey(object):
20    """MongoDB internal MaxKey type."""
21
22    __slots__ = ()
23
24    _type_marker = 127
25
26    def __getstate__(self):
27        return {}
28
29    def __setstate__(self, state):
30        pass
31
32    def __eq__(self, other):
33        return isinstance(other, MaxKey)
34
35    def __hash__(self):
36        return hash(self._type_marker)
37
38    def __ne__(self, other):
39        return not self == other
40
41    def __le__(self, other):
42        return isinstance(other, MaxKey)
43
44    def __lt__(self, dummy):
45        return False
46
47    def __ge__(self, dummy):
48        return True
49
50    def __gt__(self, other):
51        return not isinstance(other, MaxKey)
52
53    def __repr__(self):
54        return "MaxKey()"
class MaxKey:
20class MaxKey(object):
21    """MongoDB internal MaxKey type."""
22
23    __slots__ = ()
24
25    _type_marker = 127
26
27    def __getstate__(self):
28        return {}
29
30    def __setstate__(self, state):
31        pass
32
33    def __eq__(self, other):
34        return isinstance(other, MaxKey)
35
36    def __hash__(self):
37        return hash(self._type_marker)
38
39    def __ne__(self, other):
40        return not self == other
41
42    def __le__(self, other):
43        return isinstance(other, MaxKey)
44
45    def __lt__(self, dummy):
46        return False
47
48    def __ge__(self, dummy):
49        return True
50
51    def __gt__(self, other):
52        return not isinstance(other, MaxKey)
53
54    def __repr__(self):
55        return "MaxKey()"

MongoDB internal MaxKey type.