Тёмный

What are __slots__ in Python? Optimize Your Code! 

NeuralNine
Подписаться 351 тыс.
Просмотров 10 тыс.
50% 1

In this video, we learn about slots in Python and how we can use them to optimize our code.
◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾
📚 Programming Books & Merch 📚
🐍 The Python Bible Book: www.neuralnine.com/books/
💻 The Algorithm Bible Book: www.neuralnine.com/books/
👕 Programming Merch: www.neuralnine.com/shop
💼 Services 💼
💻 Freelancing & Tutoring: www.neuralnine.com/services
🌐 Social Media & Contact 🌐
📱 Website: www.neuralnine.com/
📷 Instagram: / neuralnine
🐦 Twitter: / neuralnine
🤵 LinkedIn: / neuralnine
📁 GitHub: github.com/NeuralNine
🎙 Discord: / discord

Наука

Опубликовано:

 

8 янв 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 14   
@TheRetroEngine
@TheRetroEngine 6 месяцев назад
You, sir, are a mean-machine of knowledge and perseverance. Appreciated. Been watching for quite a few years now.
@gxost_off
@gxost_off 6 месяцев назад
Quite underrated channel tbh. So much useful things to learn.
@andiglazkov4915
@andiglazkov4915 6 месяцев назад
Thanks ☺️
@pythoneatssquirrel
@pythoneatssquirrel 5 месяцев назад
if you will get a runtime error with if __name__ == '__main__': freeze_support() ... The "freeze_support()" line can be omitted if the program is not going to be frozen to produce an executable. the solution is to add under if __name__ == '__main__': everything that is after the for loop (including it)
@PatrickSteil
@PatrickSteil 6 месяцев назад
Great video. Do we know why the memory usage is lower?
@jedpittman6739
@jedpittman6739 3 месяца назад
same question here
@WabuhWabuh
@WabuhWabuh 6 месяцев назад
bro you need to explain the function...whats the point of the video if your just giving variables...you could have just made a twitter post about it...-.- it would have been way more effective than this...
@thomasgoodwin2648
@thomasgoodwin2648 6 месяцев назад
How does this affect subclassing? 🖖😎👍
@DevByAmir
@DevByAmir 6 месяцев назад
i wonder where did you learned or found this functionality ? any website or reference?
@pingzhong-pl5sb
@pingzhong-pl5sb 5 месяцев назад
i had seen it from fluent python
@SiarheiAkhramenia
@SiarheiAkhramenia 28 дней назад
No single word about internals. How does `__slots__` work? Why it isn't enabled by default? What are pros and cons of using `__slots__` over `__dict__`? Moreover, `__slots__` should be `tuple`, not `list`, as you're not going to change it and thus there's no need to confuse users of your class.
@oguzhantopaloglu9442
@oguzhantopaloglu9442 6 месяцев назад
Its 2024, nobody cares about saving memory :P
@OlegSenn
@OlegSenn 5 месяцев назад
Were you on the Cyberpunk dev team?
@Maegtur
@Maegtur 4 месяца назад
i program in micropython with micro-controllers. and i care a lot about memory ;)
Далее
Garbage Collection in Python: Speed Up Your Code
16:41
Unpacking Operators in Python: What are * and **?
12:35
Happy 4th of July 😂
00:12
Просмотров 21 млн
PLEASE Use These 5 Python Decorators
20:12
Просмотров 100 тыс.
This Is Why Python Data Classes Are Awesome
22:19
Просмотров 794 тыс.
Functools is one of the MOST USEFUL Python modules
13:37
shutil: The Ultimate Python File Management Toolkit
14:32
Every Python dev falls for this (name mangling)
14:11
Просмотров 136 тыс.
Partial Functions in Python - Functools Tutorial
14:12
Python Typing - Type Hints & Annotations
24:46
Просмотров 108 тыс.
This Algorithm is 1,606,240% FASTER
13:31
Просмотров 756 тыс.
Set Operations in Python Simply Explained
16:22
Просмотров 2,4 тыс.
Сложная распаковка iPhone 15
1:01
Просмотров 14 тыс.