Библиотека Python разработчика | Книги по питону
Погружение в CPython и архитектуру. Разбираем неочевидное поведение (GIL, Memory), Best Practices (SOLID, DDD) и тонкости Django/FastAPI. Решаем задачи с подвохом и оптимизируем алгоритмы. 🐍 По всем вопросам @evgenycarter РКН clck.ru/3Ko7Hq
إظهار المزيد📈 نظرة تحليلية على قناة تيليجرام Библиотека 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
متاح الآن! بحث تيليغرام 2025 — أهم رؤى العام 
