/
ilya.petrash
/
SimplePyScripts
Обзор
Документация
Войти
/
ilya.petrash
/
SimplePyScripts
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
profile__example.py
31 строка
493 B
gil9red
Refactoring. Using black code style
18 июн 2023, 17:01
18 июн 2023, 17:01
5949d4f
Код
Авторство
О чём код?
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = "ipetrash" import profile def foo(number=100): def _inc_i(): nonlocal i i += 1 def _has(value, items): return value in items items = ["1234567890" for _ in range(number)] print(items) i = 0 for i in range(number): _inc_i() _has("5", items) print(i) profile.run(r"foo(1000)") # LOOK: 1000 0.016 0.000 0.016 0.000 profile__example.py:14(_has)