|
|
|
|
|
by notatallshaw
247 days ago
|
|
I assume in your example if you update the foo declaration to the following it solves the complaint: foo: list[str] = []
If so this a type checking design choice: * What can I infer from an empty collection declaration?
* What do I allow further down the code to update inferences further up the code?
I don't know Pyrefly's philosophy here, but I assume it's guided by opinionated coding guidelines inside Meta, not what is perhaps the easiest for users to understand. |
|
As far as their philosophy goes, it's an open issue they're working on, so their philosophy seems to agree this particular pattern should work :)