I'm trying to do a list comprehension with an if and that requires an else, but in the else case I do not want anything added to the list.
For example, if I do this: white_list = [l.control_hub.serial_number if l.wblist == wblist_enum['WHITE'] else None for l in wblist] I end up with None in my list for the else cases. Is there a way I can do this so for the else cases nothing is added to the list? -- https://mail.python.org/mailman/listinfo/python-list