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

AI学習ツールを解放

登録して、すべての動画からより速く学べる強力なツールにアクセスしましょう。

シーン解説 フレーズハンター カードで復習 シャドーイング練習 トークバック
無料で登録
B1 中級 英語 15:39 2,570 単語 Science & Tech

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

Late Night with Seth Meyers · 101,989 回視聴 · 追加日 1ヶ月前

AI要約

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.

学習統計

B1

CEFRレベル

2,570

総単語数

609

ユニークな単語

4/10

難易度

語彙の多様性 24%

字幕 (381 セグメント)

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.

完全な字幕は動画プレーヤーで利用可能

重要な語彙 (50)

you A1 pronoun

あなたは親切です。(You are kind.)

run A1 verb

走る: 彼は毎朝公園を走っています。経営する: 彼女は小さなカフェを経営しています。

create A1 verb

「作る」や「創造する」という意味で、新しいものを生み出すことを指します。画家は美しい絵を創造します。

練習問題に挑戦

この動画から語彙・文法・読解の練習問題を作成

語彙と文法 読解クイズ IELTS試験 ライティング練習
登録して練習
まだコメントがありません。最初に考えをシェアしましょう!

登録してすべての機能を解放しよう

進捗を追跡、単語を保存、演習で練習しよう

無料で語学を始める