Adds "self" to restored methods even if not in __doc__; closes PY-38.

Sorry, no meaningful test yet %)
This commit is contained in:
Dmitry Cheryasov
2008-08-07 00:09:32 +04:00
parent 17cbaf366f
commit f86dcc6c8b
@@ -419,6 +419,12 @@ class ModuleRedeclarator(object):
spec = reqargs + [n + v for (n, v) in zip(optargs, optargvals)]
else:
funcdoc = None
# here we could have an empty spec because the doc comment states so
if p_class and not spec:
spec.append("self")
if sig_note:
sig_note += "; "
sig_note += "added 'self'"
self.out("def " + p_name + "(" + ", ".join(spec) + "): # " + sig_note, indent);
self.outDocstring(funcdoc, indent+1)
self.out("pass", indent+1);