Skip to content

Commit 573a060

Browse files
author
Ivan Dlugos
committed
remove some type hints to bring the support Python 3.5+
1 parent f849719 commit 573a060

5 files changed

Lines changed: 13 additions & 13 deletions

File tree

objectbox/builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
class Builder:
77
def __init__(self):
88
self._model = Model()
9-
self._directory: str = ''
9+
self._directory = ''
1010

1111
def directory(self, path: str) -> 'Builder':
1212
self._directory = path

objectbox/model/entity.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ def __init__(self, cls, id: int, uid: int):
1515
raise Exception("invalid or no 'uid' given in the @Entity annotation")
1616

1717
self.cls = cls
18-
self.name: str = cls.__name__
18+
self.name = cls.__name__
1919
self.id = id
2020
self.uid = uid
2121

22-
self.last_property_id: 'IdUid' = None # set in model.entity()
22+
self.last_property_id = None # IdUid - set in model.entity()
2323

24-
self.properties: List[Property] = list()
25-
self.offset_properties: List[Property] = list()
26-
self.id_property: Property = None
24+
self.properties = list() # List[Property]
25+
self.offset_properties = list() # List[Property]
26+
self.id_property = None
2727
self.fill_properties()
2828

2929
def __call__(self, *args):

objectbox/model/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def __bool__(self):
1717

1818
class Model:
1919
def __init__(self):
20-
self._entities: List[type] = list()
20+
self._entities = list()
2121
self._c_model = obx_model_create()
2222
self.last_entity_id = IdUid(0, 0)
2323
self.last_index_id = IdUid(0, 0)

objectbox/model/properties.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@ class Property:
77
def __init__(self, py_type: type, id: int, uid: int):
88
self._id = id
99
self._uid = uid
10-
self._name: str = "" # set in Entity.fillProperties()
10+
self._name = "" # set in Entity.fillProperties()
1111

12-
self._py_type: type = py_type
13-
self._ob_type: OBXPropertyType
12+
self._fb_type = None # flatbuffers.number_types
13+
self._py_type = py_type
14+
self._ob_type = OBXPropertyType(0)
1415
self.__set_basic_type()
1516

1617
self._is_id = isinstance(self, Id)
17-
self._flags: OBXPropertyFlags = 0
18+
self._flags = OBXPropertyFlags(0)
1819
self.__set_flags()
1920

2021
# FlatBuffers marshalling information
21-
self._fb_type: object # flatbuffers.number_types
2222
self._fb_slot = self._id - 1
2323
self._fb_v_offset = 4 + 2*self._fb_slot
2424

tests/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class TestEntity:
99
int = Property(int, id=4, uid=1004)
1010
float = Property(float, id=5, uid=1005)
1111
bytes = Property(bytes, id=6, uid=1006)
12-
transient: str = "" # not "Property" so it's not stored
12+
transient = "" # not "Property" so it's not stored
1313

1414
def __init__(self, string: str = ""):
1515
self.str = string

0 commit comments

Comments
 (0)