[Python-ideas] Re: Custom keywords (from: Decorators for class non function properties)

2020-08-18 Thread Greg Ewing
On 18/08/20 5:39 pm, Marco Sulla wrote: The new `@const` will be added as a hook to the PEG parser. if the PEG parser finds a `@const`, it will invoke the miniparser of `mykeywords` module inherent to `@const`. I don't think this is likely to be accepted into the language. Guido has always been

[Python-ideas] Re: Custom keywords (from: Decorators for class non function properties)

2020-08-18 Thread Aveheuzed
The new `@const` will be added as a hook to the PEG parser. if the PEG parser finds a `@const`, it will invoke the miniparser of `mykeywords` module inherent to `@const`. In this case, it will simply transform `@const a = 1` in `const PyObject* a = PyLong_FromSsize_t((Py_ssize_t) 1)` Now that