Extending Python by Adding Keywords & Data types

Ben Finney bignose+hates-spam at benfinney.id.au
Wed Aug 1 05:27:42 CEST 2007


Maximus Decimus <vishak.1981 at gmail.com> writes:

> II want to add some more KEYWORDS

Adding keywords can only be done by changing the parser for the Python
compiler. You can download the source for your preferred
implementation of Python (e.g. CPython) and change it there.

But likely that's not the best approach. Can you tell us what problem
you are trying to solve, and why you think adding keywords to the
language is desirable?

> and DATATYPES into the python script apart from the existing ones.

Adding datatypes is done by defining classes. Please work through the
tutorial (as a series of exercises to perform and understand) in order
to get a better grounding in these and other basic topics of Python.

    <URL:http://docs.python.org/tut/>

-- 
 \      "Smoking cures weight problems. Eventually."  -- Steven Wright |
  `\                                                                   |
_o__)                                                                  |
Ben Finney



More information about the Python-list mailing list