Git Product home page Git Product logo

Comments (4)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 29, 2024
Fixed in version 1.7.2.5

Original comment by pyscripter on 20 Nov 2006 at 7:56

  • Changed state: Fixed

from pyscripter.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 29, 2024
def test():
    pass
    """This should not be PyDOC!"""

still produces a PyDOC string. According to the Python documentation
(http://www.python.org/dev/peps/pep-0257/):
"A docstring is a string literal that occurs as the first statement in a module,
function, class, or method definition. Such a docstring becomes the __doc__ 
special
attribute of that object."

Note: the "raw" and "unicode" strings does not seems to be supported either.

Original comment by [email protected] on 22 Nov 2006 at 10:18

from pyscripter.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 29, 2024
a) Triple quote comments not immediately after the definition of a class and a 
function

You are right on this point.  However one has to be pragmatic and balance the 
speed
of parsing and coding with the treatment of corner cases.  How often have you 
seen
stand-alone triple quote strings in the middle of a function?  If it is for 
comment
purposes one would just use comments. Note that assignments such as 
a = """ string """
are not treated as docstrings.


b) raw and unicode triple quote comments are supported.  Try
def f():
    r"""Test Comment"""
    pass

def g():
    u"""Test Comment"""
    pass

Original comment by pyscripter on 22 Nov 2006 at 11:20

from pyscripter.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 29, 2024
> You are right on this point.  However one has to be pragmatic and balance the 
speed
of parsing and coding with the treatment of corner cases.
Why so? To identify the doc sting you only have to parse the first statement 
after
the definition. If the line does not begin with a triple while now you look 
through
the whole code. My feeling is that it will be even faster. 
> How often have you seen stand-alone triple quote strings in the middle of a
function?  If it is for comment purposes one would just use comments. 
Yes, that's my coding habits. I often copy large parts of code to mangle with 
it, and
putting triple code at the beginning and the end is faster than commenting each 
line.
:-P This is how I found this bug in the first place.

Oops, sorry. I actually meant:
def g():
    u"""T\xe9st Comm\xe9nt"""
    pass
Should be: “Tést Commént”

and

def h():
    """Test Comme\nt"""
    pass

Should be: “Test Comme
t”

You are right, the raw is behaving as expected – shows the string literally.

Original comment by [email protected] on 23 Nov 2006 at 2:30

from pyscripter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.