Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于字符串格式化 #4

Closed
OctavianLee opened this issue Sep 15, 2015 · 6 comments

Comments

@OctavianLee
Copy link

commented Sep 15, 2015

字符串格式化确实有两种形式,某些库推荐使用%,譬如logging库,当你用format形式的时候,pylint检查会给warning。不过个人还是蛮喜欢format的。

@taizilongxu

This comment has been minimized.

Copy link
Owner

commented Sep 22, 2015

format更优雅 哈哈

@OctavianLee

This comment has been minimized.

Copy link
Author

commented Sep 22, 2015

@taizilongxu 是的。这个issue只是说那个题目,不全面。很多库里,是推荐使用%的。

@taizilongxu

This comment has been minimized.

Copy link
Owner

commented Sep 22, 2015

恩, 看了下logging是01年的老库, format是2.6版本新特性(08年), 看来很有可能是为了兼容的问题

哎 其实自己写的时候还是用%比较多...

@OctavianLee

This comment has been minimized.

Copy link
Author

commented Sep 22, 2015

嗯,所以 对那边的文字需要更正一下 说明 不过项目很赞,star了

@taizilongxu

This comment has been minimized.

Copy link
Owner

commented Sep 22, 2015

: )

taizilongxu added a commit that referenced this issue Sep 22, 2015

@truebit

This comment has been minimized.

Copy link

commented Sep 18, 2018

3.6的f-string更优雅,可以加到考题中

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.