python / will c local change string.punctuation

2019-04-13 14:44发布

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条回答
倾城 Initia
2楼-- · 2019-04-13 15:06

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

查看更多
登录 后发表回答