[MERGE] Patch: smtp_connection.py

Amit Saha amitsaha.in at gmail.com
Thu May 7 09:33:30 BST 2009


Hello Martin,


On Thu, May 7, 2009 at 1:02 PM, Martin Pool <mbp at sourcefrog.net> wrote:
> 2009/5/7 Aaron Bentley <aaron at aaronbentley.com>:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Amit Saha wrote:
>>>> Please submit a patch that makes only the changes you want.
>>>
>>> Please find the patch attached. Sorry for the earlier trouble.
>
> Thanks for the patch.
>
> I'll just expand a bit on Aaron's correct comments because Amit may be
> new to Python:
>
>>>
>>>  from bzrlib import (
>>>      config,
>>> @@ -56,6 +57,11 @@
>>>          self._smtp_username = config.get_user_option('smtp_username')
>>>          self._smtp_password = config.get_user_option('smtp_password')
>>>
>>> +      """ If the password is not found in the configuration file, then prompt the user"""
>>
>> Please use # for comments, not docstrings.
>
> Python has this kind of weird syntax where if the first statement in a
> scope is a literal string, it's attached to the __doc__ attribute of
> the method/class/module/function/etc and can be shown by help().
> However, within a function this does nothing and may waste time.
>
>
>>
>>> +
>>> +      if self._smtp_password is "":
>>
>> Please compare strings with ==, not is.
>
> 'is' compares for pointer equality and may not be true for equal
> strings.  (Like = vs .equals in java iirc.)

Thank you very much for your helpful comments. However, in
consultation with Vincent, the bug was found somewhere else:
https://bugs.launchpad.net/bzr/+bug/372800

I am looking to work on it now.

Thanks,
Amit

>
> --
> Martin <http://launchpad.net/~mbp/>
>



-- 
http://amitksaha.blogspot.com
http://amitsaha.in.googlepages.com/
cornucopic on #scheme, #lisp, #math, #linux

*Bangalore Open Java Users Group*:http:www.bojug.in

"Recursion is the basic iteration mechanism in Scheme"
--- http://c2.com/cgi/wiki?TailRecursion



More information about the bazaar mailing list