Closed macdjord closed 5 years ago
Sorry for the delay, man. I've been really busy lately. Again, I coudn't reproduce the error. Can you provide a piece of code showing the error?
Thank you very much!
import mongoengine as _me
class Test(_me.Document):
map_field = _me.MapField(_me.StringField)
def do_stuff(self):
# E1135: Value 'self.map_field' doesn't support membership test (unsupported-membership-test)
if 'toto' in self.map_field:
pass
# E1133: Non-iterable value self.map_field is used in an iterating context (not-an-iterable)
for k in self.map_field:
pass
# E1137: 'self.map_field' does not support item assignment (unsupported-assignment-operation)
self.map_field['foo'] = 'bar'
# E1138: 'self.map_field' does not support item deletion (unsupported-delete-operation)
del self.map_field['baz']
Thank you very much!
It is fixed on master and I've released pylint-mongoengine==0.3.3
to PyPI.
When I lint my MongoEngine docs, I constantly get warnings about non-iterable values being used in an iterable context when I'm iterating over list fields. It would be very nice if those messages could be suppressed for fields which are, in fact, iterable.