On Aug 2, 12:35 am, Steven D'Aprano <st...@remove-this-
cybersource.com.au> wrote:
>
> I'm looking for a way to hide the generation of objects from the caller,
> so I could do something like this:
>
> from Module import factory() as a  # a == "Object #1"
> from Module import factory() as b  # b == "Object #2"
>

Explicit is better than implicit. In other words, I don't see why you
need to hide this. Just import the factory function and call it.

from Module import factory
a = factory()
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to