Very nice spec, almost exactly what I was looking for for one of my experiments. There's just one thing I wanted to ask (since it's not mentioned in rejected ideas), why not "stacked" annotations? Something like
is valid syntax and extra brackets would separate multiple annotations nicely. Or it could be used together with slices magic to provide some "namespacing" and potentially reduce the verbosity somewhat:
We could increase complexity even further with something like
Annotated[ 'sql': 'bigint': 'Big and important int field', 'check (field < 100)', ]
I checked, mixing tuples and slices is still valid syntax. No idea what mypy and other tools would think about this kind of abuse though.
I'm sure there were reasons for designing it the way it's described in the spec, I was just curious whether something like above was ever considered and, if rejected, why.
Annotated[::][:,:('o'):,:('o'):,:][::][""""I'm just gonna leave this here"""]