@WorldNews · Post #73539 · 23.03.2026 г., 05:44
Treasury secretary defends U.S. military actions in Iran: 'Sometimes you have to escalate to de-escalate' [Read FullArticle] @WorldNews#USIranTensions#MilitaryAction#GlobalSecurity
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
Пребарај: #militaryaction
@WorldNews · Post #73539 · 23.03.2026 г., 05:44
Treasury secretary defends U.S. military actions in Iran: 'Sometimes you have to escalate to de-escalate' [Read FullArticle] @WorldNews#USIranTensions#MilitaryAction#GlobalSecurity
@CryptoM · Post #65327 · 12.04.2026 г., 23:15
🚀 U.S. Considers Military Action Against Iran Amid Stalled Peace Talks U.S. President Donald Trump and his administration are contemplating the resumption of limited military strikes against Iran. According to NS3.AI, this potential action may involve a blockade of the Strait of Hormuz. The objective of these measures is reportedly to address the current deadlock in peace negotiations between the two nations. #US#Iran#MilitaryAction#PeaceTalks#Trump#StraitOfHormuz#InternationalRelations
@CryptoM · Post #64699 · 09.04.2026 г., 14:55
🚀 Polymarket Predicts Low Probability of Trump Ending Iran Military Action by April 21 The probability of U.S. President Donald Trump announcing the end of military action against Iran by April 21 has significantly decreased to 21%, according to Odaily. This marks a 22% drop in the past 24 hours, with the total trading volume for this event contract nearing $17 million. The contract stipulates that if President Trump, the U.S. government, or the military officially announces the end of the military action initiated on February 28, 2026, by the specified date (Eastern Time), the market will resolve as 'yes.' Otherwise, it will resolve as 'no.' Valid statements must clearly indicate the end of the action. Informal statements, anonymous sources, or leaked information do not qualify. However, Trump's public written statements, such as posts on his "Truth Social" account, and videos on his social media accounts are considered valid. The primary basis for market resolution is official statements from the U.S. government and/or its representatives, with additional consideration given to consensus from other credible reports. On the first day of a temporary ceasefire between the U.S. and Iran, Israeli forces launched the largest airstrike against Hezbollah since the conflict began. Iran claimed this violated the ceasefire agreement, leading to the closure of the Strait of Hormuz and threats of deterrent action against Israeli military targets. The White House announced that the first round of U.S.-Iran talks will take place on the 11th in Pakistan. However, Iran stated that three key ceasefire terms have been violated, undermining the "basis for negotiations." Despite this, Iran's Deputy Foreign Minister, Saeed Khatibzadeh, confirmed that the Iranian delegation will attend the talks in Islamabad, Pakistan. #Polymarket#Trump#Iran#militaryaction#US#ceasefire#Israel#Hezbollah#StraitOfHormuz#WhiteHouse#USIranTalks#Pakistan#SaeedKhatibzadeh#TruthSocial#USGovernment