[pypy-svn] r27198 - pypy/dist/pypy/module/stackless/test

stephan at codespeak.net stephan at codespeak.net
Sun May 14 11:28:14 CEST 2006


Author: stephan
Date: Sun May 14 11:28:12 2006
New Revision: 27198

Modified:
   pypy/dist/pypy/module/stackless/test/coro1.py   (props changed)
   pypy/dist/pypy/module/stackless/test/stack1.py   (props changed)
   pypy/dist/pypy/module/stackless/test/stack2.py   (props changed)
   pypy/dist/pypy/module/stackless/test/stack3.py   (props changed)
   pypy/dist/pypy/module/stackless/test/stackless_.py   (contents, props changed)
Log:
just set eol-style=native


Modified: pypy/dist/pypy/module/stackless/test/stackless_.py
==============================================================================
--- pypy/dist/pypy/module/stackless/test/stackless_.py	(original)
+++ pypy/dist/pypy/module/stackless/test/stackless_.py	Sun May 14 11:28:12 2006
@@ -11,13 +11,13 @@
 # interface from original stackless
 # class attributes are placeholders for some kind of descriptor
 # (to be filled in later).
-
-note = """
-The bomb object decouples exception creation and exception
-raising. This is necessary to support channels which don't
-immediately react on messages.
-
-This is a necessary Stackless 3.1 feature.
+
+note = """
+The bomb object decouples exception creation and exception
+raising. This is necessary to support channels which don't
+immediately react on messages.
+
+This is a necessary Stackless 3.1 feature.
 """
 class bomb(object):
     """
@@ -41,11 +41,11 @@
     traceback = None
     type = None
     value = None
-
-note = """
-cframes are an implementation detail.
-Do not implement this now. If we need such a thing in PyPy,
-then it will probably have a different layout.
+
+note = """
+cframes are an implementation detail.
+Do not implement this now. If we need such a thing in PyPy,
+then it will probably have a different layout.
 """
 class cframe(object):
     """
@@ -53,11 +53,11 @@
     __slots__ = ['f_back','obj1','obj2','obj3','i','n']
 
 # channel: see below
-
-note = """
-The future of C stacks is undecided, yet. This applies
-for Stackless, only at the moment. PyPy will use soft-switching
-only, until we support external callbacks.
+
+note = """
+The future of C stacks is undecided, yet. This applies
+for Stackless, only at the moment. PyPy will use soft-switching
+only, until we support external callbacks.
 """
 class cstack(object):
     """
@@ -66,10 +66,10 @@
     of program state. This structure is highly platform dependant.
     Note: For inspection, str() can dump it as a string.
     """
-
-note = """
-I would implement it as a simple flag but let it issue
-a warning that it has no effect.
+
+note = """
+I would implement it as a simple flag but let it issue
+a warning that it has no effect.
 """
 def enable_softswitch(flag):
     """
@@ -83,9 +83,9 @@
     By default, soft switching is enabled.
     """
     pass
-
-note = """
-Implementation can be deferred.
+
+note = """
+Implementation can be deferred.
 """
 def get_thread_info(thread_id):
     """
@@ -102,7 +102,7 @@
 # def run(timeout): see below
 
 # def schedule(retval=stackless.current) : see below
-
+
 note = 'needed'
 def schedule_remove(retval=None):
     """
@@ -112,9 +112,9 @@
     schedule_remove(retval=stackless.current) -- ditto, and remove self.
     """
     pass
-
-note = """
-should be implemented for debugging purposes. Low priority
+
+note = """
+should be implemented for debugging purposes. Low priority
 """
 def set_channel_callback(callable):
     """
@@ -128,8 +128,8 @@
     """
     pass
 
-note = """
-should be implemented for debugging purposes. Low priority
+note = """
+should be implemented for debugging purposes. Low priority
 """
 def set_schedule_callback(callable):
     """
@@ -143,12 +143,12 @@
     Pass None to switch monitoring off again.
     """
     pass
-
-note = """
-this was an experiment on deriving from a module.
-The idea was to make runcount and current into properties.
-__tasklet__ and __channel__ are also not used.
-It is ok to ignore these.
+
+note = """
+this was an experiment on deriving from a module.
+The idea was to make runcount and current into properties.
+__tasklet__ and __channel__ are also not used.
+It is ok to ignore these.
 """
 class slpmodule(object):
     """
@@ -161,7 +161,7 @@
     """
 
 # class tasklet: see below
-
+
 note = 'drop'
 def test_cframe(switches, words=0):
     """
@@ -222,11 +222,11 @@
     maintasklet = mt
     coro_reg[c] = mt
 
-note = """
-It is not needed to implement the watchdog feature right now.
-But run should be supported in the way the docstring says.
-The runner is always main, which must be removed while
-running all the tasklets. The implementation below is wrong.
+note = """
+It is not needed to implement the watchdog feature right now.
+But run should be supported in the way the docstring says.
+The runner is always main, which must be removed while
+running all the tasklets. The implementation below is wrong.
 """
 def run():
     """
@@ -240,12 +240,12 @@
     If an exception occours, it will be passed to the main tasklet.
     """
     schedule()
-
-note = """
-I don't see why coro_reg is needed.
-tasklets should ideally inherit from coroutine.
-This will create unwanted attributes, but they will
-go away when we port this to interp-leve.
+
+note = """
+I don't see why coro_reg is needed.
+tasklets should ideally inherit from coroutine.
+This will create unwanted attributes, but they will
+go away when we port this to interp-leve.
 """
 def getcurrent():
     """
@@ -277,32 +277,32 @@
 #    __slots__ = ['alive','atomic','block_trap','blocked','frame',
 #                 'ignore_nesting','is_current','is_main',
 #                 'nesting_level','next','paused','prev','recursion_depth',
-#                 'restorable','scheduled','thread_id']
-
-    ## note: most of the above should be properties
-
-    ## note that next and prev are not here.
-    ## should this be implemented, or better not?
-    ## I think yes. it is easier to keep the linkage.
-    ## tasklets gave grown this, and we can do different
-    ## classes, later.
-    ## well, it is a design question, but fow now probably simplest
+#                 'restorable','scheduled','thread_id']
+
+    ## note: most of the above should be properties
+
+    ## note that next and prev are not here.
+    ## should this be implemented, or better not?
+    ## I think yes. it is easier to keep the linkage.
+    ## tasklets gave grown this, and we can do different
+    ## classes, later.
+    ## well, it is a design question, but fow now probably simplest
     ## to just copy that.
 
-    def __init__(self, func=None):
+    def __init__(self, func=None):
         ## note: this field should reuse tempval to save space
         self._func = func
 
-    def __call__(self, *argl, **argd):
-        ## note: please inherit
-        ## note: please use spaces after comma :-)
+    def __call__(self, *argl, **argd):
+        ## note: please inherit
+        ## note: please use spaces after comma :-)
         ## note: please express this using bind and setup
         self._coro = c = coroutine()
         c.bind(self._func,*argl,**argd)
         coro_reg[c] = self
         self.insert()
         return self
-
+
     ## note: deprecated
     def become(self, retval=None):
         """
@@ -314,7 +314,7 @@
         If retval is not given, the tasklet is used as default.
         """
         pass
-
+
     ## note: __init__ should use this
     def bind(self):
         """
@@ -345,7 +345,7 @@
         Blocked tasklets need to be reactivated by channels.
         """
         scheduler.insert(self)
-
+
     ## note: this is needed. please call coroutine.kill()
     def kill(self):
         """
@@ -356,7 +356,7 @@
         the tasklet will silently die.
         """
         pass
-
+
     ## note: see the C implementation about how to use bombs
     def raise_exception(self, exc, value):
         """
@@ -382,12 +382,12 @@
         Run this tasklet, given that it isn't blocked.
         Blocked tasks need to be reactivated by channels.
         """
-        scheduler.setnexttask(self)
-        ## note: please support different schedulers
+        scheduler.setnexttask(self)
+        ## note: please support different schedulers
         ## and don't mix calls to module functions with scheduler methods.
         schedule()
-
-    ## note: needed at some point. right now just a property
+
+    ## note: needed at some point. right now just a property
     ## the stackless_flags should all be supported
     def set_atomic(self):
         """
@@ -405,7 +405,7 @@
         See set_ignore_nesting.
         """
         pass
-
+
     ## note: see above
     def set_ignore_nesting(self,flag):
         """
@@ -420,18 +420,18 @@
             t.set_ignore_nesting(tmp)
         """
         pass
-
-    ## note
-    ## tasklet(func)(*args, **kwds)
-    ## is identical to
+
+    ## note
+    ## tasklet(func)(*args, **kwds)
+    ## is identical to
     ## t = tasklet; t.bind(func); t.setup(*args, **kwds)
     def setup(self,*argl,**argd):
         """
         supply the parameters for the callable
         """
         pass
-
-    ## note: this attribute should always be there.
+
+    ## note: this attribute should always be there.
     ## no class default needed.
     tempval = None
 
@@ -448,11 +448,11 @@
 #                 'schedule_all']
 
     def __init__(self):
-        self.balance = 0
+        self.balance = 0
         ## note: this is a deque candidate.
         self._readq = []
         self._writeq = []
-
+
     ## note: needed
     def close(self):
         """
@@ -513,7 +513,7 @@
             nt, self._readq = self._readq[0], self._readq[1:]
             scheduler.priorityinsert(nt)
         schedule()
-
+
     ## note: see the C implementation on how to use bombs.
     def send_exception(self, exc, value):
         """
@@ -522,7 +522,7 @@
         Behavior is like channel.send, but that the receiver gets an exception.
         """
         pass
-
+
     ## needed
     def send_sequence(self, value):
         """
@@ -536,10 +536,10 @@
 
 
 class Scheduler(object):
-    def __init__(self):
+    def __init__(self):
         ## note: better use a deque
-        self.tasklist = []
-        ## note: in terms of moving to interplevel, I would not do that
+        self.tasklist = []
+        ## note: in terms of moving to interplevel, I would not do that
         self.nexttask = None 
 
     def empty(self):
@@ -588,9 +588,9 @@
     def setnexttask(self,task):
         if task not in self.tasklist:
             self.tasklist.insert(task)
-        try:
-            ## note: this is inefficient
-            ## please use the flag attributes
+        try:
+            ## note: this is inefficient
+            ## please use the flag attributes
             ## a tasklet 'knows' if it is in something
             i = self.tasklist.index(task)
             self.nexttask = i
@@ -602,6 +602,6 @@
 
 scheduler = Scheduler()
 __init()
-
-## note: nice work :-)
-
+
+## note: nice work :-)
+



More information about the Pypy-commit mailing list