A question of style

david.stegbauer at cz.opel.com david.stegbauer at cz.opel.com
Wed Aug 4 03:20:26 EDT 1999


Roy Smith wrote:
> I'm thinking of giving my base widget class a cursor method, which looks like:
>
>def cursor(self):
>   return self.page.handler.server.db.cursor()
>
>and then I can just do self.cursor() inside my widgets.

If you make alias like
cursor = self.page.handler.server.db.cursor
then you can simply call cursor() function - it is much faster than your
version.

David






More information about the Python-list mailing list