projects
/
ieee754fpu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8247364
)
add comment on _spec
author
Luke Kenneth Casson Leighton
<lkcl@lkcl.net>
Mon, 29 Apr 2019 22:46:30 +0000
(23:46 +0100)
committer
Luke Kenneth Casson Leighton
<lkcl@lkcl.net>
Mon, 29 Apr 2019 22:46:30 +0000
(23:46 +0100)
src/add/stageapi.py
patch
|
blob
|
history
diff --git
a/src/add/stageapi.py
b/src/add/stageapi.py
index eb90315c7fcc70518839ed95403ad2a1831bec91..dd969ae4ab3fc76d0404e9b7abd41c7c9cfae78d 100644
(file)
--- a/
src/add/stageapi.py
+++ b/
src/add/stageapi.py
@@
-80,6
+80,13
@@
import nmoperator
def _spec(fn, name=None):
+ """ useful function that determines if "fn" has an argument "name".
+ if so, fn(name) is called otherwise fn() is called.
+
+ means that ispec and ospec can be declared with *or without*
+ a name argument. normally it would be necessary to have
+ "ispec(name=None)" to achieve the same effect.
+ """
if name is None:
return fn()
varnames = dict(inspect.getmembers(fn.__code__))['co_varnames']