2012-07-16

Math Symbol as Function Name in Python 3

Wee, python 3 now supports Unicode in variable and function names! Example:

# Python 3

def ƒ(n):
    return n+1

α = 4
print(ƒ(α)) # prints 5

In python 2, you can't do that, also, you'll have to put # -*- coding: utf-8 -*- in the first line if your script if it contains any unicode string.