Special Methods, OOP, Iteration - Intermediate Python Programming p.21

preview_player
Показать описание
Welcome to part 21 of the intermediate Python programming tutorial series. In this tutorial, we're going to take a unique opportunity to mesh OOP, iterables, iterators, special methods, AND generators.

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

Thank You for these great tutorials! After I got interested in Pygame your video series was the only thing I needed. This series began just in time because I'm starting and intermediate Python course in university after Christmas. Keep these videos coming! I'm looking forward to a new Pygame tutorial you mentioned a few episodes back. Maybe it could also be an intermediate version? :)

Fiifufu
Автор

We don't have to copy the value of _current_ before incrementing. We could just initialize _current_ with -1.

Cubinator
Автор

Damn man so puffed up topic explained very lucidly!!

dhairyaasthana
Автор

I would like to create a new datatype using the magic methods which will remove all the duplicates and maintain the order and does all the list methods like append, pop, remove, index .... so on, can you please guide me

viswaspotnuru
Автор

Hey I'm asking my NLTK question here since it's a recent video and more chances of you looking at it. I'm actually coming from your NLTK tutorials. The voted classifier didn't improve the accuracy much as compared to accuracies achieved by the individual classifiers. Can you please give a tutorial(s) on ensembles. Thanks.

soumilmandal
Автор

Tut tut, your class name "range_examp" used the function naming convention, should'a used CamelCase! Love you anyway

MisterDidactic
Автор

I think the lines after 'yield' run on the next call

mpete
Автор

"one more, one more, and then I'll leave you to you demise."
at 12:22







I think you meant, "devices"

ThePlayerNotJump
Автор

Don't really get this at all.
Why can you iterate over a class instance? How does Python know what I mean by "for i in range_examp(5)"? What exactly would "i" be in this case? Also I don't quite get the explanation for why you need to copy the return_val. __next__() is supposed to change the current value, why does it even have to return anything?

Paivren
Автор

x1 = range(5)
x2 = (i for i in range(5))

difference is that x1 is not an iterator object but x2 is an iterator object. so we can't apply next to x1 but, we can apply next to x2.

am i right ??? 👍🤔🤔🙄🙄

jankipatel
Автор

your explanation was not very clear, I didn't really see why some showed neither iter or next and some both and some just one

TheGuyBehindYu
Автор

It would be helpful for your viewers to know that you are working with Python 3 and that some of the things you show are not implemented or implemented differently in Python 2.

aikimark
visit shbcf.ru