22.10.19 06:41, Andrew Barnert via Python-ideas пише:
2: I'm not sure what this would to to uses of "@" as an operator, as has been
suggested various times for various laudable reasons; remember that an @decorator or
other function definition is just another statement, and arbitrary
On 21Oct2019 20:41, Andrew Barnert wrote:
On Oct 21, 2019, at 19:53, Cameron Simpson wrote:
On 21Oct2019 17:18, Yonatan Zunger wrote:
I came across a case which *might* be a use case for a syntax extension, but
I'm not sure. Wanted to get feedback from the group.
*The extension: *Extend
Steve Jorgensen wrote:
> had not thought of that. That actually does work. :)
> I would say that means there is no need for a new feature, but would it make
> sense for
> this idiom to be documented in a PEP or some other easily discoverable place?
Sorry. I forgot to quote for context.
had not thought of that. That actually does work. :)
I would say that means there is no need for a new feature, but would it make
sense for this idiom to be documented in a PEP or some other easily
discoverable place?
___
Python-ideas mailing list --
On 21Oct2019 17:18, Yonatan Zunger wrote:
I came across a case which *might* be a use case for a syntax
extension, but I'm not sure. Wanted to get feedback from the group.
*The extension: *Extend the decorator syntax from
decorator ::= "@" dotted_name ["(" [argument_list [","]] ")"] NEWLINE
On Mon, Oct 21, 2019 at 8:21 PM Yonatan Zunger wrote:
>
> Hey everyone,
>
> I came across a case which might be a use case for a syntax extension, but
> I'm not sure. Wanted to get feedback from the group.
[...]
> @CronJob('job-name', params...).override('dev', more-params...)
> def
On Mon, Oct 21, 2019, at 22:30, Random832 wrote:
> On Mon, Oct 21, 2019, at 22:00, Steve Jorgensen wrote:
> > I think some idea like this might be worth proposing. the first idea
> > that comes to my mind is to allow the name of a decorator to be an
> > fstring using `@'...'` or `@"..."` syntax.
On Mon, Oct 21, 2019, at 22:00, Steve Jorgensen wrote:
> I think some idea like this might be worth proposing. the first idea
> that comes to my mind is to allow the name of a decorator to be an
> fstring using `@'...'` or `@"..."` syntax.
>
> If, for example, you have `method_type = 'class'`,
I think some idea like this might be worth proposing. the first idea that comes
to my mind is to allow the name of a decorator to be an fstring using `@'...'`
or `@"..."` syntax.
If, for example, you have `method_type = 'class'`, then you could decorate a
method using `@'{method_type}method'`.