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
Desbloqueie ferramentas de aprendizado com IA
Cadastre-se para acessar ferramentas poderosas que ajudam a aprender mais rápido com cada vídeo.
Python Has the Best Standard Library Ever: 10 Modules You Need to Know
Resumo 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.
Estatísticas de aprendizado
Nível CEFR
Total de palavras
Palavras únicas
Dificuldade
Legendas (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.
Legendas completas disponíveis no player de vídeo
Vocabulário-chave (50)
Você é muito especial. (You are very special.)
Correr: Ele corre na praia todos os finais de semana. Gerenciar: Ela gerencia uma equipe de desenvolvedores de software.
Criar significa fazer algo novo existir. Um músico pode criar uma melodia que toca o coração das pessoas.
Pratique com exercícios
Gere exercícios de vocabulário, gramática e compreensão deste vídeo
Comentários (0)
Faça Login para ComentarCadastre-se para desbloquear todos os recursos
Acompanhe seu progresso, salve vocabulário e pratique com exercícios
Modo interativo
Questionário
Resposta certa:
Vídeos relacionados
Late Night with Seth Meyers
Questionário
Resposta certa:
Os quizzes aparecem enquanto você assiste ao vídeo
Dica de memorização
Deste vídeo
Aprenda idiomas de grátis