Author: cito
Date: Sun Jan  6 10:44:44 2013
New Revision: 499

Log:
Mutable default params are dangerous.

Modified:
   trunk/module/pg.py

Modified: trunk/module/pg.py
==============================================================================
--- trunk/module/pg.py  Sun Jan  6 10:43:53 2013        (r498)
+++ trunk/module/pg.py  Sun Jan  6 10:44:44 2013        (r499)
@@ -132,7 +132,7 @@
 class pgnotify(object):
     """A PostgreSQL client-side asynchronous notification handler."""
 
-    def __init__(self, pgconn, event, callback, arg_dict={}, timeout=None):
+    def __init__(self, pgconn, event, callback, arg_dict=None, timeout=None):
         """Initialize the notification handler.
 
         pgconn   - PostgreSQL connection object.
@@ -147,7 +147,7 @@
         self.event = event
         self.stop = 'stop_%s' % event
         self.callback = callback
-        self.arg_dict = arg_dict
+        self.arg_dict = arg_dict or {}
         self.timeout = timeout
 
     def __del__(self):
_______________________________________________
PyGreSQL mailing list
[email protected]
https://mail.vex.net/mailman/listinfo.cgi/pygresql

Reply via email to