Ранее я уже упоминал о другой фишке из ˍˍfutureˍˍ , это оператор деления.
from __future__ import division
Суть проста. Раньше сложность типа данных результата поределялась типом самого сложного операнда.
Например:
int/int => int
int/float => float
В первом случае оба операнда int, значит и результат будет int. Во втором float более сложный тип, поэтому результат будет float.
Если нам требуется получить дробное значение при делении двух int то приходилось форсированно один из операндов конверировать в float.
12/float(5) => float
Но с новой "философией" это не требуется. В Python3 "floor division" заменили на "true division" а старый способ теперь работает через оператор "//".
>>> 3/2
1.5
>>> 3//2
1
То есть теперь деление int на int даёт float если результат не целое число.
В классах теперь доступны методы __floordiv__() и __truediv__() для определения поведения с этими операторами.
Данный переход описан в PEP238.
#pep#2to3#basic
🚨 TokenPocket Now Supports #Base Chain MultiSig Wallets!
Whether for team collaboration, family asset management, or personal security layers, you can effortlessly create base MultiSig wallets on TokenPocket — upgrading your crypto safety to new heights!
✨ What is a MultiSig Wallet?
✅ Requires multiple approvals to execute transactions (e.g., 2/3 signatures)
✅ Eliminates single-point failure risks
✅ Supports major EVM chains like ETH/BSC/Base — deploy with zero coding
📲 Secure your assets now 👇
MultiSig Wallet Tutorial: https://help.tokenpocket.pro/en/wallet-faq-en/multisig-wallet/create
#MultiSig#Web3#CryptoSecurity#TokenPocket
🔐 One-stop security, powered by TokenPocket!
👉https://tokenpocket.pro
🚀 Monad Foundation Offers Subsidies for Secure Signing Devices
Monad Foundation has announced plans to subsidize the cost of dedicated signing laptops for teams whose protocols achieve or exceed a total value locked (TVL) of $2.5 million. According to Foresight News, these laptops are intended for use in multi-signature operations, vault management, and other critical tasks. Eligible teams can apply to the Monad Foundation for this subsidy, which may require additional security training and standard KYC procedures. Monad emphasizes that these signing devices must not be used for everyday activities such as web browsing, coding, or meetings.
Previously, Monad co-founder Keone Hon advised protocol teams to immediately adopt dedicated signing computers for multi-signature operations instead of using regular computers. He highlighted the vulnerability of everyday computers to hacking, which could compromise the signing process even when connected to a hardware wallet, posing significant security risks. The Monad Foundation may introduce incentives to encourage teams to adopt this secure method in the future.
#MonadFoundation#Subsidy#SecureSigning#Cryptocurrency#Blockchain#Multisig#VaultManagement#Cybersecurity#KYC#ProtocolSecurity