On 10 February 2017 at 12:16, Chris Angelico <ros...@gmail.com> wrote: > On Fri, Feb 10, 2017 at 10:13 PM, Paul Moore <p.f.mo...@gmail.com> wrote: >> Furthermore, once we open up this possibility, I would expect requests >> for things like >> >> func_table = {} >> func_table["foo"] = lambda a, b: a+b >> def func_table["bar"] (a,b): >> return a-b >> >> pretty quickly. How would you respond to those? (Setting up function >> tables is a much more common and reasonable need than monkeypatching >> classes). > > Which is why these proposals always seem to gravitate to "anything you > can assign to", which is at least easy enough to explain. All your > examples would be completely acceptable.under that system.
But what do __name__ and __qualname__ get set to? What happens if you do this at class scope, rather than at module level or inside another function? What happens to the zero-argument super() support at class scope? What happens if you attempt to use zero-argument super() when *not* at class scope? These are *answerable* questions (and injecting the right __class__ cell reference for zero-argument super() support is a compelling technical argument in favour of this feature over ordinary attribute binding operations), but there's a lot more to the proposal than just relaxing a syntactic restriction in the language grammar. Cheers, Nick. -- Nick Coghlan | ncogh...@gmail.com | Brisbane, Australia _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/