The video owner has disabled playback on external websites.
This video is no longer available on YouTube.
This video cannot be played right now.
Watch on YouTube
Desbloquea herramientas de aprendizaje con IA
Regístrate para acceder a herramientas potentes que te ayudan a aprender más rápido con cada video.
Python Has the Best Standard Library Ever: 10 Modules You Need to Know
Resumen IA
This video explores Python's powerful built-in standard library, highlighting modules that streamline development and reduce the need for external dependencies. Learners will discover how to simplify data structures using **dataclasses** and manage file systems more intuitively with the object-oriented **pathlib**. The tutorial also covers **functools** for performance optimization through caching, **tomllib** for native configuration parsing, and **graphlib** for managing complex task dependencies. Finally, it introduces **heapq** for efficient priority queue management. By mastering these underutilized tools, viewers will gain the skills to write cleaner, more "Pythonic" code and improve their software design efficiency.
Estadísticas de aprendizaje
Nivel MCER
Total de palabras
Palabras únicas
Dificultad
Subtítulos (381 segmentos)
Python's standard library is crazy
powerful. Most people know about JSON or
OS, but there are modules that can save
you hours of work and you're probably
not using them. Today, I'll show you 10
powerful standard modules you should
absolutely know about. Before I start,
if you want to learn more about how to
design a piece of software from scratch,
I have a free guide for you. You can get
it at iron.code/design
guide. This contains the seven steps I
take when I design new software and
hopefully it helps you avoid some of the
mistakes I made in the past. The link is
also in the video description. First
module I want to talk about is data
classes. Now you are probably already
using data classes, but I still think it
deserves a mention on this list. You
might also say, "Hey, didn't you do a
video a couple of weeks ago where you
said you were no longer using data
class? So what is this all about?" Well,
it's not that I'm no longer using data
classes. I actually still use them, but
I don't use them in production systems
as much because then I notice that I
often end up using things like Pantic or
whatever ships with the specific
framework or library I'm working with.
Now, data class themselves are still
quite helpful to me. I really use them
quite often for quickly coming up with
some ideas in my Python scripts,
creating a few classes that store a bit
of data, making some relationships, and
seeing how everything fits together. And
for me, data class work really well for
that because they're just so easy to
use. Here you see an example of how they
work. So you simply import the data
class decorator from data classes. You
put that on top of your class and then
you specify the attributes of the class
by using type annotations. You can do
default values like this which is really
helpful. And there's a ton of other
things as well. For example, you can
also make a data class frozen. And that
way if you do that and actually type
booleans correctly, then you can also
make read only data class, read only
objects, which is quite nice as well.
Also, data classes add a bunch of
default behavior. For example, in this
case, as you can see, there's no need
for initializer, but we still have one
where we can pass the arguments uh as we
want. Uh there is a wrapper. So, if you
print a in this case an instance of that
data class, it's going to give us
something useful instead of just the
memory address. So, overall data classes
are really helpful for that. Here you
see what we get as a result when I run
this little piece of code. The second
library that I think more people should
use is path lip which basically supplies
a modern way of dealing with file path.
It replaces os.path with an
object-oriented approach to file path.
And the nice thing about path lil is
that you can use the slash operator to
construct more complex paths. So in this
case I have my base which is the my
project folder. That's a path object.
Subtítulos completos disponibles en el reproductor
Vocabulario clave (50)
¿Cómo estás tú? (How are you?)
Correr: Él corre cinco kilómetros cada día. Dirigir: Ella dirige un restaurante muy famoso en la ciudad.
Crear significa producir algo de la nada o a partir de una idea. Los niños crean mundos imaginarios cuando juegan.
Practica con ejercicios
Genera ejercicios de vocabulario, gramática y comprensión de este video
Comentarios (0)
Inicia Sesión para ComentarRegístrate para desbloquear todas las funciones
Sigue tu progreso, guarda vocabulario y practica con ejercicios
Modo interactivo
Cuestionario
Respuesta correcta:
Vídeos relacionados
Late Night with Seth Meyers
Cuestionario
Respuesta correcta:
Los quizzes aparecen mientras ves el video
Truco para recordar
De este video
Aprende idiomas gratis