Home  >  Q&A  >  body text

代码规范 - Python代码,你会严格遵守PEP8吗?

Python代码,你会严格遵守PEP8吗?比如代码一行不超过79个字符,如果正好是80个字符,你会为了遵守PEP8而对代码进行调整吗?

PHPzPHPz2741 days ago1693

reply all(27)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-04-17 13:07:05

    Be deliberate, otherwise you will feel uncomfortable

    Not a Virgo

    reply
    0
  • 阿神

    阿神2017-04-17 13:07:05

    Willing to do so. But I don’t want to use human flesh to take the initiative to check and pay attention. So exhausted.

    If there is an IDE like NINJA that can report errors in real time, I will definitely do it.

    My attitude towards JS strict mode is the same: the official is willing to fill this hole, why not comply? Just don't waste your energy unnecessarily.

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-17 13:07:05

    For Django, 79 characters is too harsh, but other specifications are still good

    reply
    0
  • 天蓬老师

    天蓬老师2017-04-17 13:07:05

    For entrepreneurial projects, CI requires pep8, and programmers use PyCharm, which is easy and stress-free to use with #nopep8.

    reply
    0
  • 迷茫

    迷茫2017-04-17 13:07:05

    Nothing intentional, the editor has similar functions.

    reply
    0
  • ringa_lee

    ringa_lee2017-04-17 13:07:05

    No. How many characters the longest line has depends on how wide my monitor is. Now I will break the line when it reaches less than 76 characters, because the line number is added after the vertical separation. If it is too long, it will easily cause soft lines or incomplete display.

    reply
    0
  • 高洛峰

    高洛峰2017-04-17 13:07:05

    No, 79 characters is too few

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 13:07:05

    I won’t strictly comply, but the sublime and pycharm I use help me comply with a very large part of the standards.

    reply
    0
  • ringa_lee

    ringa_lee2017-04-17 13:07:05

    Yes, otherwise the tilde in pycharm will be too unpleasant, and it will cause mysophobia~

    reply
    0
  • ringa_lee

    ringa_lee2017-04-17 13:07:05

    Except for 79, everything else is complied with. There is an editor to check. It was mandatory at first, but now I’m used to it

    reply
    0
  • Cancelreply