Martin Aspeli wrote:
> Clearly, it could. But that's not the way we went. Changing it now would 
> be really damaging, and I'm not sure what would be gained.
>
> I can imagine use cases where getting a new instance each time would be 
> useful.
But that is under the full controll of the __call__ of the utility, it 
could return whatever
it wants, as long as what it returns implements the requested interface 
of course (
imagine a pool of utilities implementing the interface, some being "busy")

If you'd like to check (as a user of the ZCA) if you got a singleton for 
a utility,
then compare the lookup() against the utility returned, e.g. __call__ 
returned  self.

The distinction between utility and adapter only burdens  the ZCA with  
no gain. The
only reason for ZCA to know about it today is to decide if to return the 
registered
object or to call it. And a lot of discussion is necessary to explain 
the difference.

_______________________________________________
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )

Reply via email to