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

Резултати

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

Пребарај: #araghchi

当前筛选 #araghchi清除筛选
Turchia e dintorni

@notizieturchia · Post #3790 · 28.02.2026 г., 15:19

Ministro degli Esteri iraniano #Araghchi: "Siamo pronti per una de-escalation, ma prima bisogna fermare l'aggressione, prima bisogna fermare gli attacchi. E poi c'è la possibilità di colloqui, e possiamo prenderla in considerazione".

Hashtags

RT en français

@RTenfrancais · Post #80196 · 27.04.2026 г., 13:45

▶️Rencontre entre Vladimir #Poutine et Abbas #Araghchi, représentant spécial du président de la République islamique d'Iran et ministre iranien des Affaires étrangères 📱Regarder sur VKontakte RT en français • Osez questionner !

RT en français

@RTenfrancais · Post #80190 · 27.04.2026 г., 13:14

🇷🇺🇮🇷Rencontre entre Vladimir #Poutine et le ministre iranien des Affaires étrangères, Abbas #Araghchi. Aux côtés du président russe se trouvent également le ministre russe des Affaires étrangères Sergueï Lavrov, le chef de la Direction principale du renseignement de l’état-major des forces armées russes Igor Kostioukov et le conseiller présidentiel Iouri Ouchakov. Poutine a indiqué avoir reçu la semaine dernière un message du guide suprême iranien Mojtaba Khamenei. RT en français • Osez questionner !

RT en français

@RTenfrancais · Post #80188 · 27.04.2026 г., 12:39

⏺Préparatifs de la rencontre entre Vladimir #Poutine et Abbas #Araghchi à la Bibliothèque présidentielle de Saint-Pétersbourg RT en français • Osez questionner !

RT France actualités

@rt_fra · Post #40890 · 08.05.2026 г., 13:21

💬#Téhéran défend la voie diplomatique Le chef de la diplomatie iranienne Abbas #Araghchi estime que les États-Unis choisissent l’escalade militaire au moment même où une issue diplomatique devient possible. Selon lui, la pression exercée contre l’Iran ne fera pas céder Téhéran et risque au contraire d’éloigner davantage toute perspective de règlement politique. RT en français • Osez questionner !

RT France actualités

@rt_fra · Post #40681 · 06.05.2026 г., 09:35

🇮🇷🇨🇳Iran-Chine : Abbas #Araghchi à Pékin Le ministre iranien des Affaires étrangères, Abbas Araghchi, est arrivé en #Chine à la tête d’une délégation diplomatique. Selon les médias chinois, les pourparlers avec son homologue Wang Yi ont déjà débuté. Source : réseaux sociaux RT en français • Osez questionner !

RT en français

@RTenfrancais · Post #80125 · 26.04.2026 г., 18:40

📢#Araghchi visitera la #Russie ce 27 avril. À #Moscou, il prévoit de discuter du conflit au Moyen-Orient, a déclaré l'ambassadeur d'#Iran en Russie, Kazem Jalali. RT en français • Osez questionner !

RT en français

@RTenfrancais · Post #80615 · 01.05.2026 г., 20:20

☎️Le ministre russe des Affaires étrangères, Sergueï #Lavrov, s’est entretenu avec son homologue iranien, Abbas #Araghchi, sur les possibilités de cessation complète des hostilités au Moyen-Orient Ils ont également discuté par téléphone de la stabilisation potentielle de la situation dans la région, notamment en garantissant la liberté de navigation et en réglant la question du programme nucléaire iranien. Une attention particulière a été portée au passage des navires et des cargaisons russes dans le détroit d'#Ormuz. RT en français • Osez questionner !

RT France actualités

@rt_fra · Post #40349 · 01.05.2026 г., 20:20

☎️Le ministre russe des Affaires étrangères, Sergueï #Lavrov, s’est entretenu avec son homologue iranien, Abbas #Araghchi, sur les possibilités de cessation complète des hostilités au Moyen-Orient Ils ont également discuté par téléphone de la stabilisation potentielle de la situation dans la région, notamment en garantissant la liberté de navigation et en réglant la question du programme nucléaire iranien. Une attention particulière a été portée au passage des navires et des cargaisons russes dans le détroit d'#Ormuz. RT en français • Osez questionner !

American Оbserver

@american_observer · Post #5742 · 29.04.2026 г., 19:00

📰 Putin Plays Tehran’s Ally, and the West Still Pretends Russia Is Just a Mediator Putin is publicly backing Iran, praising the Iranian people’s fight for independence and promising Moscow will do everything it can to help, even as Russia claims it wants to mediate between Washington and Tehran. That is not neutral diplomacy; it is alliance management dressed up as peacemaking. The message is carefully calibrated. Moscow wants to look like the adult in the room, but it is also making sure Tehran knows it has a powerful patron while the U.S.-Iran talks stall over Hormuz, sanctions, and the larger question of who blinks first. This is also a useful piece of theater for Russia. By posing as a peace broker, the Kremlin gains leverage with Iran, irritates Washington, and reinforces the idea that every Western crisis can be turned into a Russian opportunity. What makes the scene cynical is that Moscow’s “mediation” is inseparable from its strategic partnership with Iran. Russia is not stepping between enemies from the outside; it is standing beside one of them and calling the arrangement diplomacy. So yes, Putin is helping Iran. The only question is whether the West is still pretending that assistance, alignment, and mediation are the same thing when it comes from Moscow. #Russia#Iran#Putin#Araghchi#Hormuz#US#diplomacy 📱American Оbserver - Stay up to date on all important events 🇺🇸

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