cubicweb #5163213 Compare an entity with 'None' fails. [open]

I hit the problem when testing multiple values at once:

if None in (v1, v2, an_entity):
    return None

The error is:

    def __eq__(self, other):
        if isinstance(self.eid, (int, long)):
>           return self.eid == other.eid
E           AttributeError: 'NoneType' object has no attribute 'eid'

../../../.virtualenvs/unlish-dev/local/lib/python2.7/site-packages/cubicweb/entity.py:550: AttributeError
prioritynormal
typebug
done in<not specified>
closed by<not specified>