Codesarray

@codesarray

Small games and the code behind them. Short coding lessons with real code and real output.

129 Abonnements14 Abonnés351 Posts
  1. Codesarray@codesarray
    Posts @codesarray
    Full video, Design patterns:
    0012
  2. Codesarray@codesarray
    Posts @codesarray
    Full video, Design patterns:
    000
  3. Codesarray@codesarray
    Python strategy pattern: just pass a function. 🐍 checkout(40, sale) -> 32.0 checkout(40, lambda p: p - 10) -> 30 #Python #Coding
    Télécharger
    100
  4. Codesarray@codesarray
    Posts @codesarray
    Full video, Design patterns:
    000
  5. Codesarray@codesarray
    Python design patterns, in 4 images. 🐍 Strategy is a function you pass in. A factory is a dict from a name to a function. Observer is a list of functions. #Python #Coding
    Télécharger
    1002
  6. Codesarray@codesarray
    Posts @codesarray
    Full video:
    000
  7. Codesarray@codesarray
    Posts @codesarray
    Full video, Profiling and performance:
    0003
  8. Codesarray@codesarray
    Python timeit.repeat: take the min, not the average. 🐍 repeat(..., repeat=5) -> 133, 108, 193, 155, 141 ms min(runs) -> 108 ms #Python #Coding
    Télécharger
    1001
  9. Codesarray@codesarray
    Posts @codesarray
    Full video, Profiling and performance:
    0003
  10. Codesarray@codesarray
    Python profiling and performance, in 4 images. 🐍 timeit compares small pieces of code. cProfile shows where a program spends time: read tottime first. #Python #Coding
    Télécharger
    1002
  11. Codesarray@codesarray
    Posts @codesarray
    Full video:
    0001
  12. Codesarray@codesarray
    Posts @codesarray
    Full video, Descriptors and metaclasses:
    000
  13. Codesarray@codesarray
    Posts @codesarray
    Full video, Memory model and garbage collection:
    000
  14. Codesarray@codesarray
    Posts @codesarray
    Full video, The import system:
    0003
  15. Codesarray@codesarray
    Posts @codesarray
    Full video, Descriptors and metaclasses:
    000
  16. Codesarray@codesarray
    Python memory management, in 4 images. 🐍 Reference counting frees most objects at once, and the garbage collector catches the cycles it misses. #Python #Coding
    Télécharger
    1005
  17. Codesarray@codesarray
    Python lazy import (3.15): the module loads on first use. 🐍 lazy import json "json" in sys.modules -> False json.dumps([1, 2]) "json" in sys.modules -> True #Python #Coding
    Télécharger
    1002
  18. Codesarray@codesarray
    Python descriptors, in 4 images. 🐍 An object on the class with __get__ and __set__ runs when you read or assign an attribute. property is built from one. #Python #Coding
    Télécharger
    1001
  19. Codesarray@codesarray
    Posts @codesarray
    Full video:
    000
  20. Codesarray@codesarray
    Posts @codesarray
    Full video, The import system:
    000
  21. Codesarray@codesarray
    Posts @codesarray
    Full video:
    0001
  22. Codesarray@codesarray
    Python import system in one idea: import checks sys.modules first, so a module runs once. 🐍 → then sys.path, first match wins → circular import? import the module, use it later → lazy import is coming in 3.15 #Python #Coding
    Télécharger
    100
  23. Codesarray@codesarray
    Posts @codesarray
    Full video, Threads, processes and free threading:
    000
  24. Codesarray@codesarray
    Posts @codesarray
    Watch it here: Next up: profiling and performance.
    000
  25. Codesarray@codesarray
    Posts @codesarray
    Full video, Memory model and garbage collection:
    000