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

Roy Smith roy at panix.com
Sun Mar 11 20:43:13 EDT 2012


In article <4f5d43900ドル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

AltStyle によって変換されたページ (->オリジナル) /