Unicode identifiers in Python?
- by viksit
Hi all,
I want to build a Python function that calculates,
and would like to name my summation function S. In a similar fashion, would like to use ? for product, and so on. I was wondering if there was a way to name a python function in this fashion?
def S (..):
..
..
That is, does Python support unicode identifiers, and if so, could someone provide an example for it?
Thanks!
Original motivation for this was a piece of Clojure code I saw today that looks like,
(defn entropy [X]
(* -1 (S [i X] (* (p i) (log (p i))))))
where S is a macro defined as,
(defmacro S
... )
and I thought that was pretty cool.