Re: Codig style: " or """
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. Generally speaking """ ... """ is reserbed for multiline string constats and those whihc need to contain both single and double quotes - such as """Python's quotes are "'" and '"'""" or """\ This is a multiline string that has one newline in it.""" [Note that there is no starting newline in the second example, as I escaped it off with the \]. 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. tnx, Sara Sara: Show your boss http://python.org/peps/pep-0008.html Be sure he understands that you are not responsible for the title :-) regards Steve -- Steve Holden+1 703 861 4237 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list
Re: Codig style: " or """
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. PEP 8: http://www.python.org/peps/pep-0008.html and for docstrings, PEP 257: http://www.python.org/peps/pep-0257.html which says: For consistency, always use """triple double quotes""" around docstrings. STeVe -- http://mail.python.org/mailman/listinfo/python-list
RE: Codig style: " or """
Try PEP 8, Guido's Style Guide: http://www.python.org/peps/pep-0008.html Good luck with your boss! *gina* -Original Message- From: Sara Khalatbari [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 13, 2005 11:13 AM To: Python List Subject: Codig style: " or """ 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. tnx, Sara __ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ -- http://mail.python.org/mailman/listinfo/python-list
Re: Codig style: " or """
On 4/13/05, Sara Khalatbari <[EMAIL PROTECTED]> 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. > the authoritative coding style guide is pep 8: http://www.python.org/peps/pep-0008.html Of course, there are style points that are debatable, but for comments, you should definitely be using triple-quotes. Pep 8 points you to pep 257, which is all about docstrings: http://www.python.org/peps/pep-0257.html Peace Bill Mill bill.mill at gmail.com -- http://mail.python.org/mailman/listinfo/python-list
Re: Codig style: " or """
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" ] ) -- http://mail.python.org/mailman/listinfo/python-list
Re: Codig style: " or """
Sara Khalatbari <[EMAIL PROTECTED]> wrote: >What are the differences between " and """ ? The triple-quote form lets you write multi-line quoted strings: """This function does a lot of neat stuff. It takes many lines of text to describe what it does. Multiple paragraphs, even. """ >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 """. Show him PEP-8 (http://www.python.org/peps/pep-0008.html). PEP-8, in turn, references a few other style PEPs. If adopting them wholesale as authoritative is all you need to keep your PHB happy, go for it. -- http://mail.python.org/mailman/listinfo/python-list
Codig style: " or """
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. tnx, Sara __ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ -- http://mail.python.org/mailman/listinfo/python-list