Greg Ewing wrote: > Tim: > >>[Greg Ewing] >> >>>Why on earth would you be trying to instantiate something >>>without having any idea what parameters are required? >> >>For example, unpickling can need to do this when a type uses the >>__getstate__ + __setstate__ pickle subsystem > > But that can't possibly work for immutable types. Right and it's also not really needed since new style classes provide __new__ and __init__ as two separate entry points. pickle would have to call __new__ on these and then call __setstate__ if the protocol is supported by the type. (At least that's how understand it should work :-) Given that approach, you don't need to call __init__ at all. Still waiting for that use case... :-) Otherwise the whole idea looks too much like a YAGNI if you ask me. -- Marc-Andre Lemburg eGenix.com Professional Python Software directly from the Source (#1, Jun 12 2003) >>> Python/Zope Products & Consulting ... http://www.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ EuroPython 2003, Charleroi, Belgium: 12 days left
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