On Wed, Mar 20, 2019 at 12:37 AM Sylvain MARIE via Python-ideas <python-ideas@python.org> wrote: > > Stephen > > > If the answer is "maybe", IMO PyPI is the right solution for distribution. > > Very wise words, I understand this point. > However as of today it is *not* possible to write such a library in a > complete way, without an additional tool from the language itself. Trust me, > I tried very hard :). Indeed `my_decorator(foo)` when foo is a callable will > always look like `@my_decorator` applied to function foo, because that's how > the language is designed. So there is always one remaining ambiguous case to > cover, and I have to rely on some ugly tricks such as asking users for a > custom disambiguator. >
Fair point. Though the custom disambiguator could be as simple as using a keyword argument - "my_decorator(x=foo)" is not going to look like "@my_decorator \n def foo". _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/