12 Python Built-in Functions I Use Every Day

preview_player
Показать описание

In this video, I’ll explore 12 of the most interesting and useful built-in functions, with examples, gotchas, and a few nerdy details you may not be aware of.

🔖 Chapters:
0:00 Intro
0:23 help
1:27 dir
3:55 range
6:13 all
9:20 any
10:19 zip
11:43 filter
13:17 map
14:29 iter
16:20 slice
18:31 type
20:05 vars
21:44 Final thoughts

#arjancodes #softwaredesign #python
Рекомендации по теме
Комментарии
Автор

zip has an interesting option 'strict=True' - it is worth to be mentioned because in production code you typically want to zip only when the len of the parameters is the same. The 'strict' is kind of a guard for it

lukashk.
Автор

Btw, a deep dive on iterators/generators would be awesome. I love how iterators are integrated in python's standard library and I miss them dearly when using some other languages.

feldinho
Автор

Arjan's python content is the best and most up-to-date content avaiable on youtube. Been following it for years, been recommending for numerous people. It helped me a lot to become senior dev which am now :)

revciuu
Автор

Worth noting, please be careful with checking if filter(...) because filter itself is always truthy even if its output (list) is empty. So we need to always "unpack" filter to tuple/set/list before checking in if statement.
Btw. It was the breaking change between py2 and py3, because in py2 filter returned list directly.

przwar
Автор

Great video. I learned a bit about built-in functions (didn't know about dir and vars). But i learned a LOT about introspection in Python.

pablostraub
Автор

After seeing this, I would love a video on all the dunder methods Python can work with (or at least the interesting ones). Thanks as always for your videos! ❤

AthabaWolfssturm
Автор

As soon you explain the help funtion ( I didn't know about it) I like this video...

lpedroza
Автор

I felt all functions are useful to me. Till now I have used them very limitedly. But after seeing this video, I learnt that we can use in some more ways like on classes and other objects. Thank you so much.

dadivenkat
Автор

A few new ones I was unaware of but my favourite and one I use fairly often, is zip().

It's so useful. 👍

hokplays
Автор

thanks, I've been using type(), dir() and range () quite often.

andyshields
Автор

Great video. One thing that would be nice is to hear your thoughts about commit comments. What should and shouldn’t go there and how to build nice release notes from them. Not Python specific, but also an opportunity to use a bit of Gen AI and why not a small Python script to manage that?

Marc-ElianBegin
Автор

Nice. Built in operators would be worth discussing, too. a = 1; ~a

Another topic: How do you manage versioning of your projects? There are so many ways out there.

menscheins
Автор

I don't know why but dir() has always given my shudders. Trying to find things by inspection rather than documentation or source just seems like stabbing in the dark. I could easily imagine thinking .empty() would empty a whole container, for example.
My latest use for all() has been in a watchdog to check other processes and tasks are still running. If not, then gracefully close down, log and reconstruct.
Cracking video. I really need to start using Jupyter for teaching at work, great way to present this video.

DrGreenGiant
Автор

I definitely don’t use filter enough! Good to see a simple use here.

mattk
Автор

I just learnt to code on my own, not advanced, but I managed to make a python script for management stuff and a lot of my script uses for loops and man, that pun on for loops being used by neondertals felt personal 😂😅 gotta learn to use filter() and other functional prog concepts now 😎😝 anyway cheers for the content 💪

nrik
Автор

`any`, `all` and `zip` I use quite often. Comprehensions kind of eliminate the need for me to use `map` or `filter` and slice syntax is typically fine for what I need.

One builtin I use quite often is `enumerate` inside of a comprehension, which gives me the index of an element in an iterable.

AndrewElgert
Автор

did know about vars, it looks superuseful😊

edward
Автор

The list/map/lambda pattern is so painful compared to a list comprehension.

tubero
Автор

In the step example c. 4:50 the upper bound is still 10 (and still not included), not a big deal, but maybe worth a little subtitle.

RichardFarmbrough
Автор

Ooh, is this a teaser for a deep dive into lambda?! 🤞

ross-spencer
welcome to shbcf.ru