On Sep 6, 1:23 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> Mohamed Yousef schrieb:
>
> > ðWhat about no Constructor , and a custom instancing function that can
> > return either None or the instance wanted
>
> That doesn't solve the underlying problem - the instance is created.
> Just because it wasn't *returned*, doesn't mean it isn't there.
>
> Diez


def __new__(cls, *args, **kwargs):
    if some_condition:
        return None
    return object.__new__(cls)

Michael Foord
--
http://www.ironpythoninaction.com/
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to