473,387 Members | 1,624 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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/
Jul 18 '05 #1
3 1562
Sara Khalatbari <sa************@yahoo.com> 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.
Jul 18 '05 #2
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" ] )
Jul 18 '05 #3
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
Jul 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Dan R Brown | last post by:
I have a large form that is generated dynamically in a jsp using xml / xslt. So, to break up this form into several "tabbed" sections, I break up the form using <div> tags. Each <div...
1
by: Markus Elfring | last post by:
How much are you interested that the attribute "style" will offer the same or similar capabilities like they are provided by the element "style" in the element "head"? Do you want that the...
4
by: mike | last post by:
regards: <a href="JavaScript:loadwindow(106,90);" style="font-family:Verdana;">元智Intranet</a> In HTML spec,are "href" and "style" called "attribute"?....@@ Could someone good give me the...
5
by: johnsuth | last post by:
I want to produce a trivial demonstration of dynamic modification. I thought that pressing a button might change its color. I studied O'Reillys books and successfully created the button with a...
5
by: Tobin Fricke | last post by:
In posting to a blog, I would like to bold every list item (<li>). Because I cannot influence the <head>...</head> section of the HTML document, I can neither add a <style>...</style> block, nor...
2
by: SAL | last post by:
I have the following line of code in my Page_Load Event of my ASP.net page: txtExplanationofChange.Attributes.Add ("style","overflow :hidden"); which allows me to can turn off the Scrollbar of my...
0
by: =?Utf-8?B?QXR1bA==?= | last post by:
When .Net 1.0 webservice (VS2003) generates a wsdl - <wsdl:binding name="TestSoap" type="tns:TestSoap"> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/(note:...
2
by: Steve Richter | last post by:
I would like to use display:inline and other CSS attributes to build an entry form. Where the heading to the left of the text box is always a set width. It is not working so I am experimenting...
1
by: msg2ajay | last post by:
hi, i am working on <div> i have to hide some part of the table. I am not able to hide that table part can anybady tell me where is the error. <html> <head> <script...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.