Crell, 16 days ago Teaching #Python folks the joys of clear and explicit object type definitions. An interesting experience... #Programming
Teaching #Python folks the joys of clear and explicit object type definitions. An interesting experience...
#Programming
ramsey, 16 days ago @Crell I don’t even know how you do that in Python.
@Crell I don’t even know how you do that in Python.
Crell, 16 days ago @ramsey Python has types, they're just elided. Basically just documentation, but use 'em. Python has @dataclass definitions, and an extension library called Pydantic that's pretty nice. Lean hard on "if you have a dict where you know the types in advance, make it a class." (Python version of "Never* Use Arrays".) It's... more capable in this regard than I expected, honestly.
@ramsey
It's... more capable in this regard than I expected, honestly.
ramsey, 16 days ago @Crell Since they’re elided, does the community have a universally agreed upon analyzer that everyone uses, like with TypeScript? In other words, if I use types in my library, can I be certain they will prevent users of my library from making type mistakes with it?
@Crell Since they’re elided, does the community have a universally agreed upon analyzer that everyone uses, like with TypeScript?
In other words, if I use types in my library, can I be certain they will prevent users of my library from making type mistakes with it?
Crell, 16 days ago @ramsey I'm not sure. I'm just relying on my IDE. 🤷♂️
@ramsey I'm not sure. I'm just relying on my IDE. 🤷♂️
Girgias, 16 days ago @ramsey @Crell The only one I know is FB's one, Pysa, in which they took the lesson learned from Zoncolan (like taint analysis, whose white paper @psalm used). But I'm guessing there are some competing one. https://engineering.fb.com/2020/08/07/security/pysa/
@ramsey @Crell The only one I know is FB's one, Pysa, in which they took the lesson learned from Zoncolan (like taint analysis, whose white paper @psalm used).
But I'm guessing there are some competing one.
https://engineering.fb.com/2020/08/07/security/pysa/
Add comment