On 21/12/2015 6:03 PM, James Schneider wrote:

        I haven't tested this, but I think that will end up looking for
        False
        (the 'not' applying to 'instance' rather than the 'in' operation) in
        self.deleted_objects, which means saving would be broken entirely.


    It certainly looks nicer. But it didn't break saving so I assume it
    means something like "if not <some expression>" which expression
    happens to be "<instance in self.deleted_objects>"


Agreed. And I did finally get a chance to test this in the interpreter
with the same result. There's gotta be some implicit action going on
that counts the 'in' as a whole expression, and not taking 'instance' as
an individual object, because my dusty algebra brain is kicking and
saying that without () to sort out the order, the 'not' should apply
only to 'instance'. I even looked it up in the docs and 'not x' has a
higher operator precedence than 'in', only feeding my confusion.Â
Â

    Your way is easier to read so I'll adopt it.


I've never seen it written out the way you had it, before.

I'll agree with that. ;-D

Now I think about it, I suspect your way (and now my preferred way) might have been an innovation for Python 3?

M


-James

--
You received this message because you are subscribed to the Google
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to django-users+unsubscr...@googlegroups.com
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com
<mailto:django-users@googlegroups.com>.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/CA%2Be%2BciXJVVTs8gpt1p978qpQNgduGDU582-99bXKo5y2BZVEUQ%40mail.gmail.com
<https://groups.google.com/d/msgid/django-users/CA%2Be%2BciXJVVTs8gpt1p978qpQNgduGDU582-99bXKo5y2BZVEUQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5677AA77.50702%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.

Reply via email to