Fix _fix_anno mangling bare list annotations#841
Conversation
|
Found 1 changed notebook. Review the changes at https://app.gitnotebooks.com/AnswerDotAI/fasthtml/pull/841 |
|
@jackhogan definitely agree the current behavior is not good - although I'm wondering if the correct behavior for non-specialised If we want the latter, we should probably also support subclasses of both list and tuple? |
|
Good point @jph00! What do you think of this revised approach:
I also found a different bug while investigating: |
|
Thanks @jackhogan :) |
Bare
listannotations (without type params) causes silent data corruption — e.g.["foo", "bar"]becomes["b", "a", "r"]— and we get anIndexErrorfor empty lists.e.g. the above works with
list[str]but doesn't with justlist