Forums

One line docStrings

General discussion about Cobra. Releases and general news will also be posted here.
Feel free to ask questions or just say "Hello".

One line docStrings

Postby hopscc » Sun Sep 07, 2008 9:33 pm

docStrings currently are allowed only of the form
Code: Select all
"""
This is a doc String
"""

i.e leading and trailing terminators on their own lines.

Thats fine for modules/files, classes and (perhaps ) methods (usually) where theres often need for a multiline description but seems unnecessarily verbose for
class vars ( instance variables)
Code: Select all
class MyClass
"""
This is MyClass which is a wonderful thing to behold,
clean and pristine in form, functional in all its uses and
superlative in its brevity
"""

    var _usefulVar1
        """
        Used for something useful like backing a property
        """
    var _anotherVar
       """
        Also useful in its own way
        """
    def aMethod as int
        """
        sole method giving interesting integers
       """

- Thats 4 lines of decl and description for each var decl only two of which is actual useful content

I'd like cobra to also support single line docStrings
e.g.
Code: Select all
""" a single line docString"""


just to deverbose the above case (var decls) some
Code: Select all
class MyClass
"""
This is MyClass which is a wonderful thing to behold,
clean and pristine in form, functional in all its uses and
superlative in its brevity
"""

    var _usefulVar1
        """Used for something useful like backing a property. """
    var _anotherVar
       """Also useful in its own way """

    def aMethod as int
        """Sole method giving interesting integers"""


comments?
hopscc
 
Posts: 632
Location: New Plymouth, Taranaki, New Zealand

Re: One line docStrings

Postby hopscc » Thu Sep 18, 2008 4:57 am

ticket:43 added
hopscc
 
Posts: 632
Location: New Plymouth, Taranaki, New Zealand

Re: One line docStrings

Postby relez » Thu Sep 18, 2008 6:14 am

hopscc wrote: var _usefulVar1
"""
Used for something useful like backing a property
"""
var _anotherVar
"""
Also useful in its own way
"""
def aMethod as int
"""
sole method giving interesting integers
"""
[/code]

I'd like cobra to also support single line docStrings
e.g.
Code: Select all
""" a single line docString"""


just to deverbose the above case (var decls) some
Code: Select all
class MyClass
"""
This is MyClass which is a wonderful thing to behold,
clean and pristine in form, functional in all its uses and
superlative in its brevity
"""

    var _usefulVar1
        """Used for something useful like backing a property. """
    var _anotherVar
       """Also useful in its own way """

    def aMethod as int
        """Sole method giving interesting integers"""


comments?


yes, both formats may be preferable depending on situations. I agree your idea.
relez
 
Posts: 69


Return to Discussion

Who is online

Users browsing this forum: No registered users and 3 guests

cron