Библиотека Python разработчика | Книги по питону
Погружение в CPython и архитектуру. Разбираем неочевидное поведение (GIL, Memory), Best Practices (SOLID, DDD) и тонкости Django/FastAPI. Решаем задачи с подвохом и оптимизируем алгоритмы. 🐍 По всем вопросам @evgenycarter РКН clck.ru/3Ko7Hq
Показати більше📈 Аналітичний огляд Telegram-каналу Библиотека Python разработчика | Книги по питону
Канал Библиотека Python разработчика | Книги по питону (@bookpython) у мовному сегменті Російська є активним учасником. На даний момент спільнота об'єднує 18 312 підписників, посідаючи 7 334 місце в категорії Технології та додатки та 36 889 місце у регіоні Росія.
📊 Показники аудиторії та динаміка
З моменту свого створення невідомо, проект продемонстрував стрімке зростання, зібравши аудиторію у 18 312 підписників.
За останніми даними від 12 червня, 2026, канал демонструє стабільну активність. Хоча за останні 30 днів спостерігається зміна кількості учасників на -83, а за останні 24 години на -1, загальне охоплення залишається високим.
- Статус верифікації: Не верифікований
- Рівень залученості (ER): Середній показник залученості аудиторії становить 5.49%. Протягом перших 24 годин після публікації контент зазвичай збирає 2.76% реакцій від загальної кількості підписників.
- Охоплення публікацій: В середньому кожен допис отримує 1 006 переглядів. Протягом першої доби публікація в середньому набирає 505 переглядів.
- Реакції та взаємодія: Аудиторія активно підтримує контент: середня кількість реакцій на один пост – 2.
- Тематичні інтереси: Контент зосереджений навколо ключових тем, таких як numbers, yield, модуль, none, декоратор.
📝 Опис та контентна політика
Автор описує ресурс як майданчик для висловлення суб'єктивної думки:
“Погружение в CPython и архитектуру. Разбираем неочевидное поведение (GIL, Memory), Best Practices (SOLID, DDD) и тонкости Django/FastAPI. Решаем задачи с подвохом и оптимизируем алгоритмы. 🐍
По всем вопросам @evgenycarter
РКН clck.ru/3Ko7Hq”
Завдяки високій частоті оновлень (останні дані отримано 13 червня, 2026), канал підтримує актуальність та високий рівень охоплення публікацій. Аналітика показує, що аудиторія активно взаємодіє з контентом, що робить його важливою точкою впливу в категорії Технології та додатки.
multiprocessing.Pool is for you. It spawns multiple processes and delegates tasks to them automatically. Simply create a pool with Pool(number_of_processes) and run p.map with the list of inputs.
In : import math
In : from multiprocessing import Pool
In : inputs = [i ** 2 for i in range(100, 130)]
In : def f(x):
...: return len(str(math.factorial(x)))
...:
In : %timeit [f(x) for x in inputs]
1.44 s ± 19.2 ms per loop (...)
In : p = Pool(4)
In : %timeit p.map(f, inputs)
451 ms ± 34 ms per loop (...)
You can also omit the number_of_processes parameter, the default value for it is the number of CPU cores on the current system.1, 2, 3. OK, so far, so good. What about tuple containing only one element? You just add trailing comma to the only value: 1,. Well, that’s somewhat ugly and error prone, but makes sense.
What about empty tuple? Is it a bare ,? No, it’s (). Do parentheses create tuple as well as commas? No, they don’t, (4) is not a tuple, it’s just 4.
In : a = [
...: (1, 2, 3),
...: (1, 2),
...: (1),
...: (),
...: ]
In : [type(x) for x in a]
Out: [tuple, tuple, int, tuple]
To make things more obscure, tuple literals often require additional parentheses. If you want a tuple to be the only argument of a function, that f(1, 2, 3) doesn’t work for an obvious reason, you need f((1, 2, 3)) instead.if, bool, not etc.
False objects are None, False, 0 of any type, and empty collections: "", [], {} etc., including custom collections with the __len__ method as long as __len__ returns 0.
You can also define custom truth value testing for your objects, the __bool__ magic method is there for this:
class Rectangle:
def __init__(self, width, height):
self._w = width
self._h = height
def __bool__(self):
return bool(self._w and self._h)
In : bool(Rectangle(2, 3))
Out: True
In : bool(Rectangle(2, 0))
Out: False
In : bool(Rectangle(0, 2))
Out: False
Mind, that __bool__ is called __nonzero__ in Python 2.__getitem__ method:
In : class Iterable:
...: def __getitem__(self, i):
...: if i > 10:
...: raise IndexError
...: return i
...:
In : list(Iterable())
Out: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
The second way is to define __iter__ method that returns an iterator. An iterator is an object with a __next__ method that returns next value from the original iterable once called:
In : class Iterator:
...: def __init__(self):
...: self._i = 0
...:
...: def __next__(self):
...: i = self._i
...: if i > 10:
...: raise StopIteration
...: self._i += 1
...: return i
...:
...: class Iterable:
...: def __iter__(self):
...: return Iterator()
...:
...:
In : list(Iterable())
Out: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
Usually, an iterator also has an __iter__ method that just returns self: it allows iterator to be iterated too, that means that most of the iterators are also iterables.zip() мы можем все немного упростить.
Обратите внимание: функция zip() возвращает zip-объект, но с помощью приведения типов вы можете преобразовать его — например, с помощью list(), tuple() или dict().
Подписывайтесь на канал 👉@pythonofffifs. These are all and any.
any returns True if some of the values are true; all returns True if all of them are. all returns True for an empty iterable while any returns False in that case.
Both functions are usually useful while used together with list comprehensions:
package_broken = any(
part.is_broken() for part package.get_parts()
)
package_ok = all(
part.ok() for part package.get_parts()
)
any and all are usually interchangeable thanks to De Morgan's laws. Choose one that is easier to understand.obj.__class__ = AnyClass
Though it's probably a bad idea to use such tricks as part of your regular architecture, it can be extremely useful during debugging. Here is how you can track all attribute accesses of an object without modifying its original code:
class User:
def __init__(self, name):
self._name = name
def to_str(self):
return '<{}>'.format(self._name)
class LoggedUser(User):
def __getattribute__(self, attr):
print('`{}` accessed'.format(attr))
return super().__getattribute__(attr)
u = User('lol')
u.__class__ = LoggedUser
print(u.to_str())search, которая позволит вам найти подстроку
Если вам нужны сложные сопоставления, например, учет регистра — этот метод подойдет вам лучше всего. Но у него есть и недостатки: сложность и скорость работы. То есть, в простеньких задачах его лучше не использовать.
Подписывайтесь на канал 👉@pythonofffif 'port' not in config:
config['port'] = 80
port = config['port']
Setting default values to dictionaries can be done more elegant:
config = config.setdefault('port', 80)
setdefault sets the new value unless some value is already set. It also returns the new stored value whether it was changed or not:
In : config = {}
In : config.setdefault('port', 80)
Out: 80
In : config.setdefault('port', 443)
Out: 80
Вже доступно! Дослідження Telegram за 2025 — головні інсайти року 
