What are __slots__ in Python? Optimize Your Code!

  Рет қаралды 11,061

NeuralNine

NeuralNine

Күн бұрын

Пікірлер: 14
@TheRetroEngine
@TheRetroEngine Жыл бұрын
You, sir, are a mean-machine of knowledge and perseverance. Appreciated. Been watching for quite a few years now.
@gxost_off
@gxost_off Жыл бұрын
Quite underrated channel tbh. So much useful things to learn.
@pythoneatssquirrel
@pythoneatssquirrel 11 ай бұрын
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 Жыл бұрын
Great video. Do we know why the memory usage is lower?
@jedpittman6739
@jedpittman6739 9 ай бұрын
same question here
@thomasgoodwin2648
@thomasgoodwin2648 Жыл бұрын
How does this affect subclassing? 🖖😎👍
@AC1mDevo
@AC1mDevo Жыл бұрын
i wonder where did you learned or found this functionality ? any website or reference?
@pingzhong-pl5sb
@pingzhong-pl5sb Жыл бұрын
i had seen it from fluent python
@andiglazkov4915
@andiglazkov4915 Жыл бұрын
Thanks ☺️
@WabuhWabuh
@WabuhWabuh Жыл бұрын
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...
@SiarheiAkhramenia
@SiarheiAkhramenia 7 ай бұрын
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 Жыл бұрын
Its 2024, nobody cares about saving memory :P
@OlegSenn
@OlegSenn Жыл бұрын
Were you on the Cyberpunk dev team?
@TamTam-i4q
@TamTam-i4q 10 ай бұрын
i program in micropython with micro-controllers. and i care a lot about memory ;)
Partial Functions in Python - Functools Tutorial
14:12
NeuralNine
Рет қаралды 17 М.
5 Useful Python Decorators (ft. Carberra)
14:34
Indently
Рет қаралды 110 М.
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН
When you have a very capricious child 😂😘👍
00:16
Like Asiya
Рет қаралды 18 МЛН
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 53 МЛН
This Algorithm is 1,606,240% FASTER
13:31
ThePrimeagen
Рет қаралды 859 М.
Debugging 101: Replace print() with icecream ic()
12:36
NeuralNine
Рет қаралды 372 М.
Garbage Collection in Python: Speed Up Your Code
16:41
NeuralNine
Рет қаралды 18 М.
A Simple & Effective Way To Improve Python Class Performance
12:40
Python's collections.abc | InvertibleDict
14:00
mCoding
Рет қаралды 46 М.
Optimize Your Python Programs: Code Profiling with cProfile
15:10
Compiled Python is FAST
12:57
Doug Mercer
Рет қаралды 121 М.
Python __slots__ and object layout explained
10:16
mCoding
Рет қаралды 93 М.
Test-Driven Development in Python: Test First Code Later
15:44
NeuralNine
Рет қаралды 12 М.
5 Useful F-String Tricks In Python
10:02
Indently
Рет қаралды 339 М.
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН