Python代码,你会严格遵守PEP8吗?比如代码一行不超过79个字符,如果正好是80个字符,你会为了遵守PEP8而对代码进行调整吗?
巴扎黑2017-04-17 13:07:05
Personally, I think following certain rules will make people who look at your code more comfortable.
If you use vim, it is recommended that you use this plug-in.
巴扎黑2017-04-17 13:07:05
Not necessarily. For example, pep does not recommend using *args **kwargs in methods. However, for the sake of code flexibility, I will consider not complying with pep8
PHP中文网2017-04-17 13:07:05
Use autopep8 to automatically format the code. Except for the 80 characters per line, I will abide by everything else, otherwise the code will look very awkward
黄舟2017-04-17 13:07:05
Yes. If you use 80, you can open two windows in vim, and it is easier to write doc. I will abide by it, but don’t do it deliberately. For example, I am used to using single quotes to write docstring comments ' instead of double quotes ".
PHP中文网2017-04-17 13:07:05
I didn’t think it had to be like this. Once the IDE is set up, I don’t have to worry about it
黄舟2017-04-17 13:07:05
I know how to do it...The code I write will look good...and I want to upload it to github..Although no one will read it, I will always be afraid that someone will make noise...
PHPz2017-04-17 13:07:05
Complies with PEP8, which is more conducive to building a standard and readable code
In fact, I think PEP8 itself is still a very loose standard