python / will c local change string.punctuation

僤鯓⒐⒋嵵緔 提交于 2019-12-21 21:25:08

问题


According to the docs, string.punctuation contains: String of ASCII characters which are considered punctuation characters in the C locale.

If I print string.punctuation I get !"#$%&'()*+,-./:;<=>?@[]^_`{|}~

Can I rely on that this string is always the same because it contains all ASCII punctuation characters or is the locale setting somehow important for this?

(I am using Python 2.7 on Xubuntu 12.04 with LANG=en_US.UTF-8)


回答1:


Yes - barring (very unlikely) future changes to ASCII or the C locale, that set of characters should remain constant.



来源:https://stackoverflow.com/questions/21068454/python-will-c-local-change-string-punctuation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!