Codig style: " or """
Will McGugan
news at NOwillmcguganSPAM.com
Wed Apr 13 11:28:24 EDT 2005
Sara Khalatbari wrote:
> Hi!
>
> Suppose you're writing a module & writing the
> definition of each function in that module in " or
> """.
> for example:
> a) "This function does this & that"
> or:
> b) """This function does blah blah blah"""
>
> What are the differences between " and """ ?
> I'm using gedit & I wanna know a bit about coding
> style.
>
> To be very honest: I have a very strict boss who looks
> for bugs in my codes & he insists to know exactly
> which 'CODING STYLE AUTHORITATIVE SOURCE' I've based
> my coding style on when using " or """.
>
> Can anybody out there give me some hint?
> Can anybody tell me where to find a document on python
> coding style.
Triple quotes allow you to have quotes inside the string. I tend to use
triple quotes if I'm writing text of any length, that way I dont need to
change anything if I do need to insert a quote. I dont think its a
matter of coding style, its purely a practical issue. If your PHB
insists on consistency, I would just use """
Will McGugan
--
http://www.willmcgugan.com
"".join( [ {'*':'@','^':'.'}.get(c,None) or chr(97+(ord(c)-84)%26) for c
in "jvyy*jvyyzpthtna^pbz" ] )
More information about the Python-list
mailing list