How to break long method name into more than one line?

Roy Smith roy at panix.com
Mon Mar 12 01:43:13 CET 2012


In article <4f5d4390$0$29891$c3e8da3$5496439d at news.astraweb.com>,
 Steven D'Aprano <steve+comp.lang.python at pearwood.info> wrote:

> You can't split tokens over multiple lines, or put any whitespace 
> between them.

Well, if you truly wanted to be perverse, you could write some kind of 
decorator:

@make_long_named_test_method('some',
                             'very',
                             'long',
                             'list',
                             'of',
                             'token',
                             'fragments')
def x(self):
   blah, blah, blah

which creates a "test_some_very_long_list_of_token_fragments" method.  
But it would be a lot easier to just use sane method names.



More information about the Python-list mailing list