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.

Explicador de cena Caça-frases Revisão com flashcards Prática de repetição Falar de Volta
Cadastrar grátis
B1 Intermediário Inglês 15:39 2,570 palavras Science & Tech

Python Has the Best Standard Library Ever: 10 Modules You Need to Know

Late Night with Seth Meyers · 101,983 visualizações · Adicionado há 1 mês

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

B1

Nível CEFR

2,570

Total de palavras

609

Palavras únicas

4/10

Dificuldade

Diversidade de vocabulário 24%

Legendas (381 segmentos)

00:00

Python's standard library is crazy

00:02

powerful. Most people know about JSON or

00:05

OS, but there are modules that can save

00:08

you hours of work and you're probably

00:10

not using them. Today, I'll show you 10

00:13

powerful standard modules you should

00:16

absolutely know about. Before I start,

00:18

if you want to learn more about how to

00:20

design a piece of software from scratch,

00:22

I have a free guide for you. You can get

00:24

it at iron.code/design

00:26

guide. This contains the seven steps I

00:29

take when I design new software and

00:31

hopefully it helps you avoid some of the

00:32

mistakes I made in the past. The link is

00:35

also in the video description. First

00:37

module I want to talk about is data

00:39

classes. Now you are probably already

00:41

using data classes, but I still think it

00:44

deserves a mention on this list. You

00:47

might also say, "Hey, didn't you do a

00:49

video a couple of weeks ago where you

00:50

said you were no longer using data

00:52

class? So what is this all about?" Well,

00:54

it's not that I'm no longer using data

00:56

classes. I actually still use them, but

00:59

I don't use them in production systems

01:02

as much because then I notice that I

01:04

often end up using things like Pantic or

01:06

whatever ships with the specific

01:09

framework or library I'm working with.

01:11

Now, data class themselves are still

01:14

quite helpful to me. I really use them

01:16

quite often for quickly coming up with

01:18

some ideas in my Python scripts,

01:20

creating a few classes that store a bit

01:22

of data, making some relationships, and

01:24

seeing how everything fits together. And

01:27

for me, data class work really well for

01:28

that because they're just so easy to

01:30

use. Here you see an example of how they

01:32

work. So you simply import the data

01:34

class decorator from data classes. You

01:37

put that on top of your class and then

01:38

you specify the attributes of the class

01:41

by using type annotations. You can do

01:44

default values like this which is really

01:46

helpful. And there's a ton of other

01:48

things as well. For example, you can

01:49

also make a data class frozen. And that

01:53

way if you do that and actually type

01:56

booleans correctly, then you can also

01:58

make read only data class, read only

02:01

objects, which is quite nice as well.

02:04

Also, data classes add a bunch of

02:06

default behavior. For example, in this

02:08

case, as you can see, there's no need

02:09

for initializer, but we still have one

02:11

where we can pass the arguments uh as we

02:14

want. Uh there is a wrapper. So, if you

02:17

print a in this case an instance of that

02:20

data class, it's going to give us

02:22

something useful instead of just the

02:23

memory address. So, overall data classes

02:26

are really helpful for that. Here you

02:28

see what we get as a result when I run

02:30

this little piece of code. The second

02:32

library that I think more people should

02:34

use is path lip which basically supplies

02:37

a modern way of dealing with file path.

02:40

It replaces os.path with an

02:42

object-oriented approach to file path.

02:44

And the nice thing about path lil is

02:47

that you can use the slash operator to

02:49

construct more complex paths. So in this

02:52

case I have my base which is the my

02:54

project folder. That's a path object.

Legendas completas disponíveis no player de vídeo

Vocabulário-chave (50)

you A1 pronoun

Você é muito especial. (You are very special.)

run A1 verb

Correr: Ele corre na praia todos os finais de semana. Gerenciar: Ela gerencia uma equipe de desenvolvedores de software.

create A1 verb

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

Vocabulário e gramática Quiz de compreensão Exame IELTS Prática de escrita
Cadastre-se pra praticar
Nenhum comentário ainda. Seja o primeiro a compartilhar suas ideias!

Cadastre-se para desbloquear todos os recursos

Acompanhe seu progresso, salve vocabulário e pratique com exercícios

Aprenda idiomas de grátis