Hi,

Is it possible to generate a list of `None' ?

opts.__dict__.values() below could be represented by [None, None, None]

---
def get_options(opts):
    """Return True or False if an option is set or not"""
    vals = opts.__dict__.values()

    for val in vals:
        if val is not None:
            return True

    return False
---

This is how I'd like to see it:

---
def get_options(opts):
    """Return True or False if an option is set or not"""
    vals = opts.__dict__.values()

    for if vals is [None * len(vals)]:
        return False

    return True
---

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to