Rock Solid Python with Python Typing Transcripts
Chapter: Typing Guidance, Patterns, and Advice
Lecture: Public Packages
Login or
purchase this course
to watch this video and the rest of the course contents.
0:00
If you think of my idea I just expressed about the boundary, well, what bigger and more concrete boundary could you have than public packages?
0:11
These are libraries that you build, that you give to other people, maybe you publish them on PyPI and you say,
0:18
this is what I've given you, go and use it. And here's how you call the functions to do so. Well, of course, you want those packages
0:27
to be very useful and helpful, consistent from types. When you publish a package, you don't want it to look crappy and cheap and amateurish.
0:37
No, this is not something you would be proud of. No, you want it to be beautiful and polished. And when people get it, go, whoa, that is nice.
0:46
Look at this package, look how thoughtful it is, look how modern it is. Look at how well it uses modern Python and the type system
0:54
to really express how I'm supposed to use it. And people with that type information, they might not even need to read your docs,
1:02
not that you shouldn't write them, but if they don't even have to go look, your package will feel very natural
1:08
and people will think this thing is built in a really nice way because I didn't even hardly have to think about how to use it,
1:14
I just started playing with it and it was obvious. Types can play a huge part in that. So when you're creating public packages,
1:23
I would certainly say at least on the boundary of that package, the public API for it, you definitely wanna use Python type-ins.