My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 678: Enable exposing only some of the functions in a module as keywords with Python's `__all__` attribute
  Back to list
Status:  Done
Owner:  pekka.klarck
Closed:  Oct 2010

Blocking:
issue 677


Sign in to add a comment
 
Project Member Reported by pekka.klarck, Oct 6, 2010
Currently all functions/methods not starting with an underscore exposed as keywords when a module is used as a library. This can cause problems such as in  issue 677 . Prefixing all the helpers with an underscore isn't a very nice general solution because you can easily forget to do that.

In my opinion the easiest solution for this problem is making it possible to list what functions actually are keywords. If you use this feature, no helper can ever be accidentally exposed as a keyword. A drawback is that you need to remember list also all new keywords, but forgetting that is easy to spot because the new keywords won't work otherwise. By default all functions would be keywords just as it's done now.

We could use some special `ROBOT_XXX` attribute for this purpose, but Python already has `__all__` which we even use with variable files. Honoring `__all__` also when creating keywords is, in my opinion, logical and also nicely solves the underlying problem.
Oct 26, 2010
Project Member #1 pekka.klarck
(No comment was entered for this change.)
Owner: pekka.klarck
Oct 27, 2010
Project Member #2 pekka.klarck
Implementation, tests, and documentation in r4272.
Status: Done
Sign in to add a comment

Powered by Google Project Hosting