Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Extending Python by Adding Keywords & Data types


  • From: bignose+hates-spam at benfinney.id.au (Ben Finney)
  • Subject: Extending Python by Adding Keywords & Data types
  • Date: Wed, 01 Aug 2007 13:27:42 +1000

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