[摘要]Python 最佳实践指南

501 查看

文档地址 The Hitchhiker’s Guide to Python!

这份文档

粗粗粗略地过了一遍,大体捞了一些东西出来,大段大段英文太费眼了,回头细读在更新进来

浓缩版,20分钟可大体过完,然后根据自己需要去看详细的吧

整体内容还是很不错的,建议细读英文

PS:文档含有巨量的TODO(没写空白着待补充的),不过但从目录上来看还是很强大滴,相信完善后,会成为一份很牛逼的指南(难度比官方指南高一点点)


第零部分 Getting Started

链接

不解释,不翻译,自个看….真的没啥(每本入门书籍第一章…)


第一部分 Writing Great Code

Structuring Your Project

链接

import 最佳实践

Very bad

Better

Best

Python中关于OOP的 观点

Decorators

动态类型(Dynamic typing)

Avoid using the same variable name for different things.

Bad

Good

It is better to use different names even for things that are related, when they have a different type:

可变和不可变类型(Mutable and immutable types)

字符串拼接最佳实践

Bad

粗粗粗略地过了一遍,大体捞了一些东西出来,大段大段英文太费眼了,回头细读在更新进来

浓缩版,20分钟可大体过完,然后根据自己需要去看详细的吧

整体内容还是很不错的,建议细读英文

PS:文档含有巨量的TODO(没写空白着待补充的),不过但从目录上来看还是很强大滴,相信完善后,会成为一份很牛逼的指南(难度比官方指南高一点点)


第零部分 Getting Started

链接

不解释,不翻译,自个看….真的没啥(每本入门书籍第一章…)


第一部分 Writing Great Code

Structuring Your Project

链接

import 最佳实践

Very bad

Better

Best

Python中关于OOP的 观点

Decorators

动态类型(Dynamic typing)

Avoid using the same variable name for different things.

Bad

Good

It is better to use different names even for things that are related, when they have a different type:

可变和不可变类型(Mutable and immutable types)

字符串拼接最佳实践

Bad