Skip to content

Commit

Permalink
Stackless issue python#79: make the module stackless IDE friendly
Browse files Browse the repository at this point in the history
Add __all__ to stackless.
Add entries to the module's __dict__ for the computed properties (i.e. current, main, ...).
This helps IDEs (PyDev) to recognise the expression "stackless.current" as a defined name.
(grafted from d5e6830501279c287a7971152a26b2ad5d244168)
  • Loading branch information
Anselm Kruis committed Feb 14, 2016
1 parent 0de0efe commit a80d383
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
29 changes: 29 additions & 0 deletions Lib/stackless.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,35 @@ def __iter__(self):
_wrap.range = range
del range

__all__ = ['atomic',
'channel',
'enable_softswitch',
'get_channel_callback',
'get_schedule_callback',
'get_thread_info',
'getcurrent',
'getcurrentid',
'getdebug',
'getmain',
'getruncount',
'getthreads',
'getuncollectables',
'pickle_with_tracing_state',
'run',
'schedule',
'schedule_remove',
'set_channel_callback',
'set_error_handler',
'set_schedule_callback',
'switch_trap',
'tasklet',
'stackless', # ugly
]

# these definitions have no function, but they help IDEs (i.e. PyDev) to recognise
# expressions like "stackless.current" as well defined.
current = runcount = main = debug = uncollectables = threads = pickle_with_tracing_state = None

def transmogrify():
"""
this function creates a subclass of the ModuleType with properties.
Expand Down
1 change: 1 addition & 0 deletions Stackless/unittests/test_outside.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import unittest
from stackless import *
from stackless import test_cframe, test_cframe_nr, test_outside, test_cstate

from support import StacklessTestCase

Expand Down

0 comments on commit a80d383

Please sign in to comment.