#1945: Mutable default argument in deluge.ui.client.DaemonSSLProxy.__init__
---------------------+------------------------------------------------------
 Reporter:  Simon    |       Owner:            
     Type:  bug      |      Status:  new       
 Priority:  trivial  |   Milestone:  Future    
Component:  gtkui    |     Version:  git master
 Keywords:           |  
---------------------+------------------------------------------------------
 Hi,

 When looking at the source code I saw that DaemonSSLProxy.__init__ have a
 mutable default parameter value:
 http://git.deluge-torrent.org/deluge/tree/deluge/ui/client.py#n269

 This may be the source of bugs as explained here:

 http://effbot.org/zone/default-values.htm#valid-uses-for-mutable-defaults

 It may be intentional, but I am not sure as I am not familiar with the
 code. If it is intentional, a comment should be added to say so.
 Otherwise, the method should be changed to look like this:


 {{{
     def __init__(self, event_handlers=None):
         if event_handlers is None:
             event_handlers = {}
 }}}

-- 
Ticket URL: <http://dev.deluge-torrent.org/ticket/1945>
Deluge <http://deluge-torrent.org/>
Deluge project

-- 
You received this message because you are subscribed to the Google Groups 
"Deluge Dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/deluge-dev?hl=en.

Reply via email to