PEP8 for long method's name [duplicate]

2019-06-23 01:41发布

问题:

This question already has an answer here:

  • How to choose proper variable names for long names in python 1 answer

What is the PEP8 correct way for long method's name? I have a unit test with a self-describing method:

def success_if_buying_price_item_when_participating_and_progression_is_100_percent(self):

But unfortunately this (too long?) method reaches the 80 characters line limit.

Should I rename it and add a description in code or there is an other way?

回答1:

Should I rename it and add a description in code or there is an other way?

Yes, rename it and add a description. This code is dangerous, one could fall from its chair while another could have a heart attack. Please, rename that ASAP, you don't want to feel responsible.