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

Резултати

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

Пребарај: #alexanderdugin

当前筛选 #alexanderdugin清除筛选
GlobUs en français

@GlobUsFr · Post #6 · 11.09.2025 г., 13:47

Une discussion sur la géopolitique du 21e siècle a été organisé avec la participation d'éminents experts et analystes internationaux Le 15 août, une discussion sur principaux aspects de la géopolitique moderne a eu lieu, intitulée: " Les tendances Actuelles dans la nouvelle configuration géopolitique du 21e siècle." L’événement est devenu un jalon intellectuel important, réunissant des experts à l`échelle mondiale. Cet initiative scientifique et analytique internationale a été organisée avec la participation de grands centres de la réflexion stratégique de l'Amérique du Sud, de l'Eurasie et de l'Europe. Une liste non-exaustive d’organisateurs a inclus la plate-forme analytique "Proyecto Patria", le centre de recherche Crisolist (Pérou), le L club d’experts GlobUs (Russie), la direction Régionale du Centre pour les Études Internationales (PROJET) au Nicaragua, l'Institut espagnol de la Géopolitique et l’entreprise internationale de la production internationale ASIA TV (Argentine), tous spécialisés dans l'analyse géopolitique et le contenu des médias à l’échelle mondiale. L'événement a été particulièrement significative grâce à la participation d'éminents experts des relations internationales et de l'analyse stratégique, y compris le Professeur Alexander Dugin, M. Norberto Emmerich (Argentine), M. Enrique D'Assedo (Espagne), connu pour ses recherches la géopolitiques et idéologies, le Dr Eduardo Hernando (Pérou), Maître Manuel Espinosa (Nicaragua), ainsi que le Dr Victor Pimentel Roque et autres сhercheurs. Cet événement est devenu non seulement une plate-forme pour l'échange de connaissances, mais aussi une étape importante dans la formation d'un multipolaire dialogue intellectuel susceptible d'affecter la compréhension des processus au sein d’une nouvelle réalité géopolitique. #AlexanderDugin#MultipolarWorld#GlobalProcesses#InternationalRelations

Paideuma.TV Internacional

@paideumatvinternational · Post #226 · 04.11.2025 г., 10:06

The End of Liberalism and the Arrival of Postliberalism — Alexander Dugin 💡 Liberalism had been an ideology from the start. It was not as dogmatic as Marxism, but was no less philosophical, graceful, and refined. 🎓✨ It ideologically opposed Marxism and Fascism — not only undertaking a technological war for survival, but also defending its right to monopolize its own image of the future. ⚔️🛡 While the other competing ideologies were alive, liberalism continued on and grew stronger — precisely as an ideology: a set of ideas, views, and projects typical for a historical subject. 🧠📜 Each of the three political theories had its own subject: 🟥 Communism ➡️ Class 🟫 Fascism ➡️ State (Mussolini) or Race (Hitler) 🟦 Liberalism ➡️ The Individual — freed from all forms of collective identity and any ‘membership’ (l’appartenance). 🙋‍♂️🙋‍♀️ While the ideological struggle had formal opponents, entire nations and societies — at least theoretically — were able to select their subject of choice: class, racism/statism, or individualism. 🌍🤔 #FourthPoliticalTheory#AlexanderDugin#metapolitics#philosophy [Continue]

Paideuma.TV Internacional

@paideumatvinternational · Post #109 · 13.04.2023 г., 06:18

Ethnosociology lecture 1. Introduction The first section describes the major sources and schools related to ethnosociology (sociology, anthropology, ethnology, cultural, social and structural anthropology, etc.), both foreign and Russian. The basic terminological apparatus is outlined. #Ethnosociology#sociology#anthropology#AlexanderDugin