Skip to content

Commit

Permalink
Fix python SyntaxWarnings
Browse files Browse the repository at this point in the history
  • Loading branch information
brondsem committed Apr 19, 2022
1 parent b22af7c commit c58ff16
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ming/mim.py
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,7 @@ def cmp(cls, x, y):

@classmethod
def to_bson(cls, val):
if val is (): return val
if val == (): return val
tp = cls.bson_type(val)
return (tp, cls._types[tp][0](val))

Expand Down
4 changes: 2 additions & 2 deletions ming/odm/identity_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ def get(self, cls, id):

def save(self, value):
vid = getattr(value, '_id', ())
if vid is not ():
if vid != ():
self._objects[value.__class__, vid] = value

def clear(self):
self._objects = {}

def expunge(self, obj):
vid = getattr(obj, '_id', ())
if vid is (): return
if vid == (): return
try:
del self._objects[(obj.__class__, vid)]
except KeyError:
Expand Down
2 changes: 1 addition & 1 deletion ming/odm/property.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def __get__(self, instance, cls=None):
if self.fetch:
st = state(instance)
result = st.extra_state.get(self, ())
if result is ():
if result == ():
result = st.extra_state[self] = self.join.load(instance)
return result
else:
Expand Down

0 comments on commit c58ff16

Please sign in to comment.