- Code: Select all
warning: Encountered "pass" in a class that already has declared members.
This is due a warning on use of "pass" in a class that already has some box members defined
(CobraParser.cobra .classPass)
as in
class X is partial
pass
class X
def foo
print 'foo.'
def main is shared
x = X()
x.foo
This use seems to indicate a worthwhile doc mechanism so seems it might be worthwhile to allow this without warning if the class is declared partial which would allow the use of an explicit specification of a partial class as a placeholder for effort to be done later
i.e a placeholder/reminder for new named methods and fields to be implemented in the future
e.g.
class X is partial
pass # must implement the variant foo methods eventually
(ticket:367)
An alternative option would be to introduce a 'todo' or 'tobeimplemented' keyword that could be placed in such classes (same as pass) to note such use as temp placeholders with perhaps some trailing text ..
extend this for methods as well??
e.g.
class X is partial
todo : Implement variant foo methods and supporting fields
# 'todo keyword indicates class is placeholder, no code generated for it
# : precedes trailing text comment/doc following (aesthetic only)
class Y
def baz
pass
# empty method baz
def bar
todo
# placeholder for method bar - no code generated
def bar1
todo : needs to adjust for froz on goober
# placeholder for method bar1 - no code generated, additional trailing note
??