TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #156 · 2 окт.

Те, кто в Python не первый день, хорошо знают, что на число можно умножить не только число, но и другие типы. Главное, чтобы у этих типов была реализация такой операции. # list >>> [1] * 3 [1, 1, 1] # tuple >>> (2, 3) * 3 (2, 3, 2, 3, 2, 3) # string >>> "A" * 3 "AAA" Так работает полиморфизм стандартных типов. Интересно здесь то, что это сработает и в том случае, когда порядок операндов обратный. То есть int умножить на [тип]. # list >>> 3 * [1] [1, 1, 1] # tuple >>> 3 * (2, 3) (2, 3, 2, 3, 2, 3) # string >>> 3 * "A" "AAA" Если хотите реализовать такое поведение в ваших классах то следует помнить два момента: 1. Если множитель справа, то вам нужно реализовать метод __mul__, наш класс это первый операнд, то есть слева. myType * 3 2. Если множитель слева, то вам нужно реализовать метод __rmul__, наш класс это второй операнд, справа. 3* myType Всё тоже самое можно делать и для других математических операторов. И если в этом примере действие и результат будут фактически одинаковыми, то бывают ситуации, когда это не так. Например, при умножении матриц имеет значение порядок операндов. Для других операторов, таких как деление или сдвиг, очень важно кто с какой стороны находится. >>> 2/4, 4/2 (0.5, 2.0) >>> 2<<3, 3<<2 (16, 12) >>> 100%15, 15%100 (10, 15) #tricks#basic

Резултати

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

Пребарај: #caas

当前筛选 #caas清除筛选
Crypto M - Crypto News

@CryptoM · Post #65244 · 12.04.2026 г., 08:36

🚀 German Hacker Arrested in Bangkok for Cybercrime Activities A 27-year-old German hacker, Noah Christopher, has been arrested in Bangkok, Thailand, facing up to 74 arrest warrants for cybercrimes in Europe. According to Odaily, investigations reveal that between 2021 and 2025, Christopher allegedly developed and operated a ransomware platform and a 'Cybercrime-as-a-Service' (CaaS) system. This included providing tools for distributed denial-of-service (DDoS) attacks, such as Fluxstress and Neldowner, assisting global clients in launching cyberattacks for payment. The ransom payments involved cryptocurrencies and other digital assets, constituting transnational cybercrime activities. His visa has been revoked, and he is currently detained awaiting extradition to Germany. #Cybercrime#Hacker#Ransomware#CaaS#DDoS#Cryptocurrency#Extradition#Thailand#Germany#TransnationalCrime

Crypto M - Crypto News

@CryptoM · Post #64994 · 10.04.2026 г., 13:15

🚀 SimpleChain Secures $15 Million in Seed Funding for RWA Network SimpleChain has announced the successful completion of a $15 million seed funding round. According to Foresight News, the funding was supported by family offices and institutional investors. SimpleChain aims to develop a Real World Asset (RWA) Layer 1 network, positioning itself as an 'Institutional OS' for RWA. The network will be powered by Granular Data and native CaaS, focusing on providing financial-grade infrastructure for the tokenization of real-world assets globally. #SimpleChain#SeedFunding#RWA#Layer1Network#InstitutionalOS#GranularData#CaaS#Tokenization#RealWorldAssets#FinancialInfrastructure