Python/ django
по всем вопросам @workakkk @itchannels_telegram - 🔥 все ит каналы @ai_machinelearning_big_data -ML @ArtificialIntelligencedl -AI @datascienceiot - 📚 @pythonlbooks РКН: clck.ru/3FmxmM
显示更多📈 Telegram 频道 Python/ django 的分析概览
频道 Python/ django (@pythonl) 俄语 语言赛道中的 是活跃参与者。目前社区聚集了 58 385 名订阅者,在 技术与应用 类别中位列第 2 244,并在 俄罗斯 地区排名第 10 292 位。
📊 受众指标与增长动态
自 невідомо 创建以来,项目保持高速增长,吸引了 58 385 名订阅者。
根据 03 十一月, 2026 的最新数据,频道保持稳定运转。过去 30 天订阅人数变化为 -242,过去 24 小时变化为 -32,整体触达仍然可观。
- 认证状态: 未认证
- 互动率 (ER): 平均受众互动率为 6.00%。内容发布后 24 小时内通常能获得 3.06% 的反应,占订阅者总量。
- 帖子覆盖: 每篇帖子平均可获得 3 501 次浏览,首日通常累积 1 784 次浏览。
- 互动与反馈: 受众积极参与,单帖平均反应数为 18。
- 主题关注点: 内容集中在 github, claude, контекст, архитектура, api 等核心主题上。
📝 描述与内容策略
作者将该频道定位为表达主观观点的平台:
“по всем вопросам @workakkk
@itchannels_telegram - 🔥 все ит каналы
@ai_machinelearning_big_data -ML
@ArtificialIntelligencedl -AI
@datascienceiot - 📚
@pythonlbooks
РКН: clck.ru/3Fm...”
凭借高频更新(最新数据采集于 04 十一月, 2026),频道始终保持新鲜度与高覆盖。分析显示受众积极互动,使其成为 技术与应用 类别中的关键影响点。
# a
# / \
# b c
# / \
# d e
edges = {"a": ["c", "b"], "b": ["d", "e"], "c": [], "d": [], "e": []}
vertices = ["a", "b", "c", "d", "e"]
def topological_sort(start, visited, sort):
current = start
visited.append(current)
neighbors = edges[current]
for neighbor in neighbors:
if neighbor not in visited:
sort = topological_sort(neighbor, visited, sort)
sort.append(current)
if len(visited) != len(vertices):
for vertice in vertices:
if vertice not in visited:
sort = topological_sort(vertice, visited, sort)
return sort
if __name__ == "__main__":
sort = topological_sort("a", [], [])
print(sort)
▪Topological sorting
▪Топологическая сортировка
@pythonlsquares = []
for x in range(10):
squares.append(x**2)
print(squares)
2. Using Generators
with open('example.txt') as f:
for line in (line.strip() for line in f):
print(line)
3. Using the zip() function
names = ['Pippo', 'Pluto', 'Paperino']
ages = [25, 30, 35]
for name, age in zip(names, ages):
print(f'{name} is {age} years old')
4. Using DefaultDict
from collections import defaultdict
s = 'hello world'
d = defaultdict(int)
for c in s:
d[c] += 1
print(d)
5. Using enumerate()
fruits = ['apple', 'banana', 'cherry']
for i, fruit in enumerate(fruits):
print(f'{i}: {fruit}')
▪Techniques to Write Better Python Code
▪Улучшение Python-кода
@pythonl# Using global variables
my_var = 42
def my_function():
global my_var
my_var += 1
return my_var
# Using local variables
def my_function2(my_var):
my_var += 1
return my_var
2. Avoid blocking I/O operations
Избегайте блокировки операций ввода/вывода
# Blocking I/O
import requests
response = requests.get('https://example.com')
print(response.text)
# Non-blocking I/O using asyncio
import asyncio
import aiohttp
async def fetch(session, url):
async with session.get(url) as response:
return await response.text()
async def main():
async with aiohttp.ClientSession() as session:
html = await fetch(session, 'https://example.com')
print(html)
asyncio.run(main())
3. Avoid using eval() and exec()
избегайте использования eval() и exec()
# Using eval() to execute code
my_var = '1 + 1'
result = eval(my_var)
# Using ast.literal_eval() to safely evaluate literals
import ast
my_var = '[1, 2, 3]'
result = ast.literal_eval(my_var)
4. Avoid using mutable default arguments
Избегайте использования изменяемых аргументов
# Using mutable default arguments
def my_function(my_list=[]):
my_list.append(1)
return my_list
result1 = my_function() # [1]
result2 = my_function() # [1, 1]
# Using immutable default arguments
def my_function2(my_list=None):
if my_list is None:
my_list = []
my_list.append(1)
return my_list
result3 = my_function2() # [1]
result4 = my_function2() # [1]
5. Avoid using *args and **kwargs excessively
Избегайте частого использования *args и **kwargs
def my_function(*args, **kwargs):
arg1 = args[0]
arg2 = kwargs.get('arg2', 'default_value')
return arg1, arg2
result = my_function('value1', arg2='value2')
# Using named arguments and default values
def my_function2(arg1, arg2='default_value'):
return arg
▪Article
▪10 самых распространенных ошибок Python
@pythonl$ pip install redis
import redis
# Create a Redis client
r = redis.Redis(host='localhost', port=6379, db=0)
# String Operations
r.set('mykey', 'Hello Redis!')
value = r.get('mykey')
print(value) # Output: b'Hello Redis!'
# List Operations
r.lpush('mylist', 'element1')
r.lpush('mylist', 'element2')
r.rpush('mylist', 'element3')
elements = r.lrange('mylist', 0, -1)
print(elements) # Output: [b'element2', b'element1', b'element3']
# Set Operations
r.sadd('myset', 'member1')
r.sadd('myset', 'member2')
r.sadd('myset', 'member3')
members = r.smembers('myset')
print(members) # Output: {b'member2', b'member1', b'member3'}
# Hash Operations
r.hset('myhash', 'field1', 'value1')
r.hset('myhash', 'field2', 'value2')
value = r.hget('myhash', 'field1')
print(value) # Output: b'value1'
# Sorted Set Operations
r.zadd('mysortedset', {'member1': 1, 'member2': 2, 'member3': 3})
members = r.zrange('mysortedset', 0, -1)
print(members) # Output: [b'member1', b'member2', b'member3']
# Delete a key
r.delete('mykey')
# Close the Redis connection
r.close()
▪Github
@pythonlstr_val = 'apples'
num_val = 42
print(f'{num_val} {str_val}') # 42 apples
2. Variable names
Apart from getting a variable's value, you can also get its name alongside the value.
str_val = 'apples'
num_val = 42
print(f'{str_val=}, {num_val = }') # str_val='apples', num_val = 42
3. Mathematical operations
Not syntactically unlike variable names, you can also perform mathematical operations in f-strings.
num_val = 42
print(f'{num_val % 2 = }') # num_val % 2 = 0
4. Printable representation
Apart from plain string interpolation, you might want to get the printable representation of a value.
str_val = 'apples'
print(f'{str_val!r}') # 'apples'
5. Number formatting
Numbers are a great candidate for this. If, for example, you want to trim a numeric value to two digits after the decimal, you can use the .2f format specifier.
price_val = 6.12658
print(f'{price_val:.2f}') # 6.13
6. Date formatting
Finally, dates can also be formatted the same way as numbers, using format specifiers. As usual, %Y denotes the full year, %m is the month and %d is the day of the month.
from datetime import datetime;
date_val = datetime.utcnow()
print(f'{date_val=:%Y-%m-%d}') # date_val=2021-07-09
▪String Formatting Best Practices
▪F-strings или как сделать код чуть более быстрым
@pythonl
from pydantic import BaseModel
class User(BaseModel):
name: str
age: int
user = User(name='John Doe', age=30)
2. Default Values
Define default values for your model fields.
class User(BaseModel):
name: str
age: int = 18 # Default value
3. Optional Fields
Mark fields as optional using the Optional type.
from typing import Optional
class User(BaseModel):
name: str
age: Optional[int] = None
4. Custom Validators
Create custom validators with the @validator decorator.
from pydantic import validator
class User(BaseModel):
name: str
age: int
@validator('age')
def validate_age(cls, value):
if value < 18:
raise ValueError('User must be 18+')
return value
5. Nested Models
Use Pydantic models to validate nested data structures.
class Address(BaseModel):
street: str
city: str
class User(BaseModel):
name: str
age: int
address: Address
6. Lists of Models
Handle lists of a specific model.
from typing import List
class User(BaseModel):
name: str
age: int
class UserList(BaseModel):
users: List[User]
7. Union Fields
Use Union to allow a field to be one of several types.
from typing import Union
class User(BaseModel):
identifier: Union[str, int]
8. Value Constraints
Impose constraints on values using Field.
from pydantic import Field
class User(BaseModel):
name: str
age: int = Field(..., gt=0, lt=120) # Greater than 0, less than 120
9. Aliases for Fields
Define aliases for model fields, which can be useful for fields that are Python keywords.
class User(BaseModel):
name: str
class_: str = Field(alias='class')
10. Recursive Models
Make models that can contain themselves.
from typing import Optional
class TreeNode(BaseModel):
value: int
left: Optional['TreeNode'] = None
right: Optional['TreeNode'] = None
TreeNode.update_forward_refs() # Resolve string annotations
@pythonlimport numpy as np
a = np.array([[1, 2, 1], [2, 2, 5]])
# get the rows whose all values are fewer than 3
mask_all = (a<3).all(axis=1)
print(a[mask_all])
"""
[[1 2 1]]
"""
mask_any = (a<3).any(axis=1)
print(a[mask_any])
"""
[[1 2 1]
[2 2 5]]
"""
▪Numpy docs
@pythonl$ pip install PyGithub
🖥 Github
📌 Документация
@pythonl