On Mon, May 01, 2006, Brett Cannon wrote: > > But there are two things that I can't quite decide upon. > > One is whether a signature object should be automatically created > for every function. As of right now the PEP I am drafting has it > on a per-need basis and have it assigned to __signature__ through > a built-in function or putting it 'inspect'. Now automatically > creating the object would possibly make it more useful, but it > could also be considered overkill. Also not doing it automatically > allows signature objects to possibly make more sense for classes (to > represent __init__) and instances (to represent __call__). But having > that same support automatically feels off for some reason to me. My take is that we should do it automatically and provide a helper function that does additional work. The class case is already complicated by __new__(); we probably don't want to automatically sort out __init__() vs __new__(), but I think we do want regular functions and methods to automatically have a __signature__ attribute. Aside from the issue with classes, are there any other drawbacks to automatically creating __signature__? -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "Argue for your limitations, and sure enough they're yours." --Richard Bach
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4