>>>>> Vishal Shetye <vishal_she...@persistent.co.in> (VS) wrote:
>VS> I want to synchronize calls using rw locks per 'group' and my >implementation is similar to >VS> http://code.activestate.com/recipes/465057/ >VS> except that I have my own Lock implementation. >VS> All my synchronized functions take 'whatGroup' as param. My lock considers >'group' while deciding on granting locks through acquire. >VS> What I could come up with is: >VS> - decorator knows(assumes) first param to decorated functions is always >'whatGroup' >VS> - decorator passes this 'whatGroup' argument to my lock which is used in >acquire logic. >VS> Is it ok to make such assumptions in decorator? As long as you make sure that all decorated functions indeed adhere to that assumption there is nothing wrong with it. -- Piet van Oostrum <p...@cs.uu.nl> URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4] Private email: p...@vanoostrum.org -- http://mail.python.org/mailman/listinfo/python-list