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

Резултати

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

Пребарај: #metz

当前筛选 #metz清除筛选
AI match predictions

@ai_match_prediction · Post #11843 · 02.05.2026 г., 05:05

France Ligue 1🇫🇷 2026-05-02 13:00 UTC Nantes vs. Marseille Predicted outcome: Marseille❌ Predicted score: 1:2 Actual: Nantes 3:0 #Nantes#Marseille 2026-05-02 15:00 UTC Paris Saint Germain vs. Lorient Predicted outcome: Paris Saint Germain❌ Predicted score: 2:1 Actual: Draw 2:2 #PSG#Lorient 2026-05-02 17:00 UTC Metz vs. Monaco Predicted outcome: Monaco✅ Predicted score: 1:2 Actual: Monaco 1:2 #Metz#Monaco 2026-05-02 19:05 UTC Nice vs. Lens Predicted outcome: Lens❌ Predicted score: 1:2 Actual: Draw 1:1 #Nice#Lens #Football#FranceLigue1

AI match predictions

@ai_match_prediction · Post #11591 · 19.04.2026 г., 05:05

France Ligue 1🇫🇷 2026-04-19 13:00 UTC Monaco vs. Auxerre Predicted outcome: Monaco❌ Predicted score: 2:1 Actual: Draw 2:2 #Monaco#Auxerre 2026-04-19 15:15 UTC Nantes vs. Stade Brestois 29 Predicted outcome: Draw✅ Predicted score: 1:1 Actual: Draw 1:1 #Nantes#StadeBrestois29 2026-04-19 15:15 UTC Strasbourg vs. Rennes Predicted outcome: Draw❌ Predicted score: 2:2 Actual: Rennes 0:3 #Strasbourg#Rennes 2026-04-19 15:15 UTC Metz vs. Paris FC Predicted outcome: Draw❌ Predicted score: 1:1 Actual: Paris FC 1:3 #Metz#ParisFC 2026-04-19 18:45 UTC Paris Saint Germain vs. Lyon Predicted outcome: Paris Saint Germain❌ Predicted score: 2:1 Actual: Lyon 1:2 #PSG#Lyon #Football#FranceLigue1

AI match predictions

@ai_match_prediction · Post #11749 · 26.04.2026 г., 09:05

France Ligue 1🇫🇷 2026-04-26 13:00 UTC Lorient vs. Strasbourg Predicted outcome: Lorient❌ Predicted score: 3:2 Actual: Strasbourg 2:3 #Lorient#Strasbourg 2026-04-26 15:15 UTC Rennes vs. Nantes Predicted outcome: Rennes✅ Predicted score: 2:1 Actual: Rennes 2:1 #Rennes#Nantes 2026-04-26 15:15 UTC Le Havre vs. Metz Predicted outcome: Le Havre❌ Predicted score: 2:1 Actual: Draw 4:4 #LEHavre#Metz 2026-04-26 15:15 UTC Paris FC vs. Lille Predicted outcome: Lille✅ Predicted score: 1:2 Actual: Lille 0:1 #ParisFC#Lille 2026-04-26 18:45 UTC Marseille vs. Nice Predicted outcome: Marseille❌ Predicted score: 3:1 Actual: Draw 1:1 #Marseille#Nice #Football#FranceLigue1

AI match predictions

@ai_match_prediction · Post #11152 · 22.03.2026 г., 09:05

France Ligue 1🇫🇷 2026-03-22 14:00 UTC Lyon vs. Monaco Predicted outcome: Draw❌ Predicted score: 1:1 Actual: Monaco 1:2 #Lyon#Monaco 2026-03-22 16:15 UTC Marseille vs. Lille Predicted outcome: Marseille❌ Predicted score: 2:1 Actual: Lille 1:2 #Marseille#Lille 2026-03-22 16:15 UTC Rennes vs. Metz Predicted outcome: Rennes❌ Predicted score: 3:1 Actual: Draw 0:0 #Rennes#Metz 2026-03-22 16:15 UTC Paris FC vs. Le Havre Predicted outcome: Draw❌ Predicted score: 1:1 Actual: Paris FC 3:2 #ParisFC#LEHavre 🔥 PREMIUM PICK 🔥 2026-03-22 19:45 UTC Nantes vs. Strasbourg Predicted outcome: Strasbourg✅ Predicted score: 1:2 Actual: Strasbourg 2:3 #Nantes#Strasbourg #Football#FranceLigue1

AI match predictions

@ai_match_prediction · Post #11310 · 05.04.2026 г., 05:05

France Ligue 1🇫🇷 2026-04-05 13:00 UTC Angers vs. Lyon Predicted outcome: Lyon❌ Predicted score: 1:2 Actual: Draw 0:0 #Angers#Lyon 2026-04-05 15:15 UTC Lorient vs. Paris FC Predicted outcome: Lorient❌ Predicted score: 2:1 Actual: Draw 1:1 #Lorient#ParisFC 2026-04-05 15:15 UTC Le Havre vs. Auxerre Predicted outcome: Draw✅ Predicted score: 1:1 Actual: Draw 1:1 #LEHavre#Auxerre 2026-04-05 15:15 UTC Metz vs. Nantes Predicted outcome: Draw✅ Predicted score: 2:2 Actual: Draw 0:0 #Metz#Nantes 2026-04-05 18:45 UTC Monaco vs. Marseille Predicted outcome: Monaco✅ Predicted score: 2:1 Actual: Monaco 2:1 #Monaco#Marseille #Football#FranceLigue1

Elena Basile Public Channel

@elenabasilepublicchanel · Post #280 · 22.08.2025 г., 08:13

Orrore! Amici e conoscenti ripetono inconsapevoli la propaganda Occidentale Puô accadere di sentirsi accerchiati dai mostri. L' essere umano si abitua. Assorbe le menzogne se ripetute dalla maggioranza. E cosî l' Europa, i #Macron gli #Starmer i #Metz e la #Meloni benedetta da #Draghi sono i democratici che non si arrendono alla forza rappresentata dagli autocrati #Trump e #Putin Gli ucraini al fronte devono continuare a essere massacrati. Ne va della libertà difesa dall' Europa #Netanyahu é un irresponsabile un pazzo ma Ah #Israele la grande storia di Israele #BenGurion#Rabin persino #Sharon Ah che miti! In fondo in fondo é colpa di #Hamas. Beh si poveri bimbi ma l ' #Occidente non c entra. Tutta colpa del terrorismo! Sono sgomenta! Guardateli tutta brava gente. Tanti buoni sentimenti per i figli e gli amici dei figli e persino per la domestica a cui si fa del bene, é sempre la nostra, dico nostra, donna delle pulizie Guardateli: hanno le mani sporche di sangue Potrebbero di nuovo appoggiare un governo nazista. Tutto dipende dalla giusta propaganda Sono tra di noi, si nascondono tra i vicini di casa, tra i conoscenti, tra i parenti stretti, a volte tra gli amici insospettati Sgomento e terrore E il grido delle vittime, dell' umanità dolente e perseguitata lacera l ' aria Lo ascoltiamo impotenti E ripensiamo al male in agguato A #SaloSade di #Pasolini Il grande poeta visionario ci aveva avvertiti in tempi lontani sui mostri presenti #GazaGenocide #FreePalestine #Russiaucrinapeace

AI match predictions

@ai_match_prediction · Post #12027 · 10.05.2026 г., 13:05

France Ligue 1🇫🇷 2026-05-10 19:00 UTC Angers vs. Strasbourg Predicted outcome: Strasbourg❌ Predicted score: 1:2 Actual: Draw 1:1 #Angers#Strasbourg 2026-05-10 19:00 UTC Paris Saint Germain vs. Stade Brestois 29 Predicted outcome: Paris Saint Germain✅ Predicted score: 3:1 Actual: Paris Saint Germain 1:0 #PSG#StadeBrestois29 2026-05-10 19:00 UTC Monaco vs. Lille Predicted outcome: Lille✅ Predicted score: 1:2 Actual: Lille 0:1 #Monaco#Lille 2026-05-10 19:00 UTC Rennes vs. Paris FC Predicted outcome: Rennes✅ Predicted score: 2:1 Actual: Rennes 2:1 #Rennes#ParisFC 2026-05-10 19:00 UTC Toulouse vs. Lyon Predicted outcome: Lyon❌ Predicted score: 1:2 Actual: Toulouse 2:1 #Toulouse#Lyon 2026-05-10 19:00 UTC Auxerre vs. Nice Predicted outcome: Auxerre✅ Predicted score: 2:1 Actual: Auxerre 2:1 #Auxerre#Nice 2026-05-10 19:00 UTC Le Havre vs. Marseille Predicted outcome: Le Havre❌ Predicted score: 2:1 Actual: Marseille 0:1 #LEHavre#Marseille 2026-05-10 19:00 UTC Metz vs. Lorient Predicted outcome: Lorient✅ Predicted score: 1:2 Actual: Lorient 0:4 #Metz#Lorient #Football#FranceLigue1