title: Python: How are objects/variables such as the complex '1j' defined?
body: <p>And how can I define my own types of variables/objects to behave with the provided operations in python?</p>
  
  <p>Can I do this without having to create my own object classes and operators as a <em>separate and distinct</em> entity? I dont mind having to create my own object class (thats a given), but I want it to integrate flawlessly with the already existing constructs. So emphasis on my wish to avoid "separate and distinct".</p>
  
  <p>Im trying to create a quaternion object class.  I want to define a 1i and 1k that are distinct from 1j.</p>
  
  <p>And yes, a package might already exist; this is purely academic and for my own programming practice and understanding.  Im trying to <em>extend</em> what is already there, and not build something that is distinct and separate.</p>
  
  <p>I already do class objects but unfortunately they require a redefinition of the basic operations in order to make use of them, and even then I have to "declare" these objects before I can use them, quite unlike '1j'.</p>
  
  <p>I hope I am clear with my intent.  The end result of a quaternion is not my intent; it is the types of methods and objects and generalizations Im trying to figure out how to do, to extend and make use of what is already built into python.</p>
  
  <p>It seems to me whoever built numpy and cmath have already been able to achieve this endeavor.</p>
  
  <hr>
  
  <p>Thanks to the commentary below. I now have the vocabulary to express my intent better.</p>
  
  <p>Im trying to add new features to Pythons SYNTAX.</p>
  
  <p>If anyone can offer resources on how to do this, Id appreciate it.</p>