I would like to know when my function is called whether or not the
return value is used. Is this doable in python? If it is, can it ever
be pythonic?
The use case is that I have functions who's side effects and return
values are cached. I would like to optimize them such that I don't
have to
2009/4/29 Zac Burns zac...@gmail.com:
I would like to know when my function is called whether or not the
return value is used. Is this doable in python? If it is, can it ever
be pythonic?
AFAIK, no, it's not.
The use case is that I have functions who's side effects and return
values are
On Wed, Apr 29, 2009 at 10:14 AM, Simon Brunning
si...@brunningonline.net wrote:
2009/4/29 Zac Burns zac...@gmail.com:
Why not return a proxy, and have the proxy do the retrieval of the
needed data if it's used? Delegation is ridiculously easy in Python.
Interesting idea. I like it.
I've
Zac Burns wrote:
I would like to know when my function is called whether or not the
return value is used. Is this doable in python? If it is, can it ever
be pythonic?
It doesn't sound Pythonic to me.
The use case is that I have functions who's side effects and return
values are cached. I
The point of caching is that it lets you retrieve a result cheaply that
was expensive to produce by saving the result in case it's needed again.
If the caching itself is expensive because it requires network access
then, IMHO, that's not proper caching! (You would need a 2-level cache,
ie a
Zac Burns wrote:
The point of caching is that it lets you retrieve a result cheaply that
was expensive to produce by saving the result in case it's needed again.
If the caching itself is expensive because it requires network access
then, IMHO, that's not proper caching! (You would need a 2-level