[issue10562] Change 'j' for imaginary unit into an 'i'

Georg Brandl report at bugs.python.org
Thu Dec 2 21:30:37 CET 2010


Georg Brandl <georg at python.org> added the comment:

We also should consider a good roadmap to account for the eventual support of quaternions in the language syntax.

Since the conventional mathematical symbols for the additional imaginary units of quaternions are j and k, confusion is bound to happen.

My preferred solution is to limit PYTHONIMAGINARYSYMBOL values to "i", "j" or "k" in Python 3.4.  The two additional imaginary unit symbols would then be a cyclic permutation of i,j,k, viz. for PYTHONIMAGINARYSYMBOL=j, the units are k and i.

This deterministic approach has the advantage that migration of code from one imaginary symbol to another is as easy as:

sed -e 's/k/l/' -e 's/j/k/' -e 's/i/j/' -e 's/l/i/'

provided that you restrict yourself not to use the characters i, j, k or l in identifiers, keywords or strings in the source code.

----------
nosy: +georg.brandl

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10562>
_______________________________________


More information about the Python-bugs-list mailing list