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

Резултати

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

Пребарај: #panafricanunity

当前筛选 #panafricanunity清除筛选
Red Nile

@rednile12 · Post #10459 · 23.12.2025 г., 16:53

🔺Continuation from above @rednile12 🌍 Key Themes 1️⃣ Impending Crisis & Imperialism The “Black Winter” represents a deliberate destabilization of West Africa—akin to an “Arab Spring” engineered for the region. Traoré warns of wars, terrorism, and economic predation orchestrated by imperial powers: “My conviction, my analysis, is clear: something is happening in West Africa. I have called it the Black Winter. The Black Winter is coming. It will be a very cold winter. A bloody winter. A deadly winter. You will ask me why. Winter will come because war is spreading in West Africa. The imperialists are doing everything they can to plunge the region into fire and bloodshed. We risk killing each other in horrific ways while others stand ready to plunder our resources and impose their will. And those who survive this tragedy will have only two choices: unite definitively against imperialism or remain enslaved until they perish.” 2️⃣ Internal Sabotage & Division Traoré criticizes Africans who undermine collective defense: “By founding the AES Confederation, we anticipated this icy winter. Every day, we search for wood to light a fire—a fire that will warm the hearts, minds, and souls of Africans. We hunt wolves to use their pelts to make coats. We build mountains—solid and powerful mountains—to break the icy winds. But unfortunately, some of our own are determined to sabotage this effort. They are dousing the tree trunks with water to prevent the fire from burning. They transform into wolves so that hunters cannot catch them. They break rocks to prevent the building of mountains. We cannot accept that cowardly heads of state hide behind so-called 'free' media to discourage, insult, and incite hatred among the people. They are vile, spreading hatred daily on social media. Why do we Black people cultivate hatred among ourselves?” 3️⃣ Pan-Africanism & Unity The speech challenges the continent to reflect on its solidarity: “And when winter arrives, those who fought will come seeking refuge. They will want to wear the coats we have made, take shelter behind the mountains we have built, and warm themselves by our fire. So the real question is this: What will become of Pan-Africanism when winter arrives? Why are we unable to see the danger approaching? Why can't we unite to stop it? Let them be certain of one thing: we are united and we will remain so. No manipulation can divide us.” 4️⃣ Self-Reliance & Sovereignty Traoré frames AES institutions—like BCID-AES Bank and AES TV—as proactive defenses against the crisis: “Everything will not be perfect. Everything will not progress at the pace we would like. But we are moving forward—calmly, resolutely—and we will achieve our goal. We pray for protection if winter must come, because through it, we will achieve freedom and unity.” 🗣 Rhetorical Style ▪️Metaphor & Allegory: “Black Winter” for isolation, bloodshed, and death. ▪️Repetition & Urgency: “Winter is coming” evokes inevitability. ▪️Direct Address & Inclusion: “You will ask me why… we” fosters solidarity. ▪️Contrast of Alarm & Hope: Harsh words (“vile,” “miserable”) versus affirmations of unity. Traoré’s style mirrors Thomas Sankara, blending militaristic charisma with Pan-African inspiration. 📌 Context & Impact ▪️Delivered as AES evolved into a full confederation post-ECOWAS withdrawal, the speech reinforces sovereignty amid jihadist threats, sanctions, and Western influence. ▪️Signals defiance and appeals to non-Western partners, while naming internal “saboteurs” risks polarizing some factions. ▪️Positions Traoré as a visionary Pan-African leader, galvanizing anti-imperialist sentiment across the continent. 🔴 Follow @rednile12 for Geopolitical updates #BlackWinter#AESConfederation#PanAfricanUnity#WestAfrica#AntiImperialism#SelfReliance#RedNileMedia#Geopolitics#AfricaRising