wamd icon indicating copy to clipboard operation
wamd copied to clipboard

Adding __contains__ to the WhatsappMessage

Open szymek156 opened this issue 3 years ago • 0 comments

That allows to check for membership of message properties using the 'in' keyword.

Example, current main:

m = WhatsAppMessage()
# this line halts, read the docs of __contains__
# https://docs.python.org/3/reference/datamodel.html#object.__contains__
'mime' in m

With this fix:

>>> 'mime' in m
False
>>> 'id' in m
True

szymek156 avatar Oct 13 '22 08:10 szymek156