Update: This answer is no longer valid. See Comment by Eugenes.
No, this is not yet possible.
In 2.10, there is only def macros that cannot match anything. For 2.11, the world is a little better; macros and implementation to introduce participants to classes already exist. But they are only a few weeks old, and therefore they will only work in some cases. In addition, the implementation for introducing members into classes lives in a different branch than the implementation for macros, so it is not yet possible to use them.
sschaef
source share