RE: question about python statements

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ohad Frand

    RE: question about python statements

    Hi Gary

    Sorry that I was not clear, I hope that this time I will explain myself
    better.

    I can get list of all builtin functions in python by dir(__builtins_ _).
    This return a list of string with most known names to python language
    such as:
    [... 'issubclass', 'iter', 'len', 'license', 'list', 'locals', 'long',
    'map', 'max', 'min', 'object', 'oct', 'open', 'ord', 'pow', 'property',
    'quit', 'range', 'raw_input', 'reduce', 'reload'...]

    But I don't know how to generate the next list of builtin python
    statements:
    ['assert','break ','class','cont inue','def','de l','elif','else ','except',
    'exec','finally ','for','from', 'global',
    'if','import',' pass','print',' raise','return' ,'try','while', 'yield']

    Thanks,
    Ohad Frand

    -----Original Message-----
    From: Gary Herron [mailto:gherron@ islandtraining. com]
    Sent: Monday, May 12, 2008 10:41 PM
    To: Ohad Frand
    Cc: python-list@python.org
    Subject: Re: question about python statements

    Ohad Frand wrote:
    >
    Hi
    >
    I am looking for a way to programmically get a list of all python
    existing statements that I cannot access by __builtins__ or locals()
    >
    (like ["assert","break ","class",. ..])
    >
    Thanks,
    >
    Ohad
    >
    >
    ------------------------------------------------------------------------Sorry, I've no idea what you mean here. Perhaps you could help us by
    defining what you mean by
    "statements that I cannot access by __builtins__ or locals()"

    Is there any statement that you *can* access in such a way?

    What does it even mean to "access a statement"?

    Do you even have a list of "statements " from which we are to work?
    Python is a little unusual in what it considers statements.

    Gary Herron




Working...