TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #32 · 7 фев.

Скорее всего уже слышали, что складывать строки через + это плохая практика. Падение производительности, и всё такое. Без лишних слов, давайте измерять: from timeit import timeit def t1(): # складываем 10 строк через + из переменной t = 'text' for _ in range(1000): s = t + t + t + t + t + t + t + t + t def t2(): # склеиваем список строк через метод join arr = ['text'] * 10 for _ in range(1000): s = ''.join(arr) def t3(): # складываем через + но не из переменной а непосредственно инлайн объекты for _ in range(1000): s = 'text' + 'text' + 'text' + ... # всего 10 раз Теперь каждую строку склейки запустим по 10М раз >>> timeit(t1, number=10000) 0.21951690399964718 >>> timeit(t2, number=10000) 1.4978306379998685 >>> timeit(t3, number=10000) 0.2213820789993406 Хм, а нам говорили что через "+" это плохо и медленно ))) 😁 Тут стоит учитывать, что речь идёт о склейке множества длинных строк. Давайте изменим условия: def t4(): t = 'text'*100 for _ in range(1000): s = t + t + t + t + t + t + t + t + t def t5(): arr = ['text'*100] * 10 for _ in range(1000): s = ''.join(arr) def t6(): for _ in range(1000): s = 'text'*100 + 'text'*100 + ... # всего 10 раз >>> timeit(t4, number=10000) 12.795130728000004 >>> timeit(t5, number=10000) 2.642637542999182 >>> timeit(t6, number=10000) 0.2184546610005782 Вот, уже другой разговор, сразу видна разница, в среднем в 6 раз. Но погодите, почему последний тест t6() по скорости такой же как и t3()? Ведь строки теперь в 100 раз длиннее! Это вопросы оптимизации кода, какие простые изменения ускоряют или замедляют выполнение программы. Мы столкнулись с примером обхода обращения к переменной. Например, именно так работает директива #define в С++, во время компиляции подставляя значение переменной вместо ссылки на неё. В Python это тоже работает, но часто ли вы сможете встретить такой способ работы со строками? К сожалению, способ почти только теоретический. В целом, тесты показали то, что мы хотели. Делаем выводы самостоятельно. Полный листинг 🌍 #tricks

Резултати

Пронајдени 35 слични објави

Пребарај: #sei

当前筛选 #sei清除筛选
American Crypto©

@americancryptotrading · Post #27568 · 25.03.2026 г., 11:03

🇺🇸#SEI/USDT has found support at the lowerborder of the descendingchannel on the 3D timeframe👀 Looks good for the midterm✈️ American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27532 · 12.02.2026 г., 09:45

🇺🇸#SEI/USDT is currently consolidating inside the descendingchannel formation on the 3D timeframe👨‍💻 Accumulate before the rocket takes off📈 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27495 · 07.01.2026 г., 11:51

🇺🇸#SEI/USDT is holding above the lowerboundary of the descendingchannel formation on the 3D timeframe💁‍♂️ Strong upside potential on a bounce🚀 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27414 · 22.10.2025 г., 08:58

🇺🇸#SEI/USDT is consolidating inside the descendingchannel pattern on the 3D chart🧐 A breakout will bring a huge rally🐃 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27360 · 30.08.2025 г., 08:46

🇺🇸#SEI/USDT has retested the s/rzone on the 2D timeframe👀 Time to bounce and rally🚀 American Crypto©

Hashtags

American Crypto©

@americancryptotrading · Post #27163 · 22.02.2025 г., 12:16

🇺🇸#SEI/USDT is facing the upperborder of the fallingwedge formation on the daily chart🔍 Bullish case if we break above the one🚀 American Crypto©

Hashtags

Bitcoin Bullets®

@bitcoinbuliets · Post #14217 · 10.05.2026 г., 20:05

#SEI Market Analysis SEI/USDT showing strong bullish momentum with price near the upper Bollinger Band and MACD confirming upward trend. RSI above 76 signals overbought conditions but doesn't negate short-term strength. Holding above 0.0591 supports continuation toward resistance at 0.0620. Bear case triggers below 0.0585, risking a deeper pullback to key supports near 0.0579. Watch 0.0591 as the pivot for bulls and bears. --- ➖➖➖➖➖➖➖ Bitcoin Bullets® Trading

Hashtags

Bitcoin Bullets®

@bitcoinbuliets · Post #14146 · 09.05.2026 г., 20:05

#SEI Market Analysis SEI/USDT showing strong bullish momentum with MACD confirming upside and RSI stretched near 74 signaling overbought conditions. Price hugging the upper Bollinger Band suggests continuation but warns of a short-term pullback. Bull case: Hold above 0.0586 to target 0.0620 and beyond. Bear case: Break below 0.0575 risks deeper correction toward 0.0550. Key level to watch: 0.0586 support. --- ➖➖➖➖➖➖➖ Bitcoin Bullets® Trading

Hashtags

Bitcoin Bullets®

@bitcoinbuliets · Post #13522 · 22.04.2026 г., 20:03

#SEI Market Analysis SEI/USDT holding a strong bullish structure with MACD confirming momentum and RSI pushing into overbought territory near the upper Bollinger Band. Price is well above key supports, showing solid demand on dips. Bull case: Hold above 0.055, targeting a test of 0.059 resistance. Bear case: Lose 0.054 support, risk deeper pullback toward 0.05385. Watch 0.055 closely for trade direction. --- ➖➖➖➖➖➖➖ Bitcoin Bullets® Trading

Hashtags

Bitcoin Bullets®

@bitcoinbuliets · Post #13511 · 22.04.2026 г., 04:03

#SEI Market Analysis SEI/USDT is in a weak bearish trend but shows short-term bullish signals with MACD turning positive and RSI near 61. Price is testing resistance near 0.056 and trading close to the upper Bollinger Band, indicating potential exhaustion. Bull case: hold above 0.056, targeting 0.059 for a relief bounce. Bear case: lose 0.055 and risk a deeper pullback toward the 0.053 support zone. Key level to watch: 0.056. --- ➖➖➖➖➖➖➖ Bitcoin Bullets® Trading

Hashtags

Bitcoin Bullets®

@bitcoinbuliets · Post #13219 · 04.04.2026 г., 04:09

#SEI Market Analysis SEI/USDT shows a weak bearish structure with price hovering near resistance at 0.05496 and RSI steady around 54. MACD is bullish and price trades in the upper half of the Bollinger Bands, signaling potential short-term strength. Bull case: hold above 0.05375 to target 0.05558 resistance. Bear case: lose 0.0509 support and risk a deeper pullback toward 0.0486. Key level to watch: 0.05375. --- ➖➖➖➖➖➖➖ Bitcoin Bullets® Trading

Hashtags

Bitcoin Bullets®

@bitcoinbuliets · Post #13215 · 03.04.2026 г., 20:09

#SEI Market Analysis SEI/USDT shows a weak bearish structure but MACD is turning bullish, signaling potential short-term strength. Price is near the upper Bollinger Band with RSI around 59, indicating room to run but also caution for a squeeze. Bull case: hold above 0.05496 for a push to 0.05595 resistance. Bear case: lose 0.0509 support and risk a deeper drop to 0.0486. Key level to watch: 0.05496. --- ➖➖➖➖➖➖➖ Bitcoin Bullets® Trading

Hashtags

ПретходнаСтраница 1 од 3Следна