[地雷] isalnum() 在不同版本有不同回傳值 - tsungjung411/python-study GitHub Wiki

Python2

$ python2
Python 2.7.6 (default, Oct 26 2016, 20:30:19) 
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> '吃'.isalnum()
False
>>> '麥'.isalnum()
False

Python3

$ python3
Python 3.4.3 (default, Nov 17 2016, 01:08:31) 
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> '吃'.isalnum()
True
>>> '麥'.isalnum()
True

isalnum 用法: