Ранее я уже упоминал о другой фишке из ˍˍ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
🔥Tangem presents integrated with
💳Visacrypto wallet
Tangem has developed a new wallet that supports direct payments through the Visa payment system. The new product for business (B2B) and consumers (B2C) will be released under the #Tangem brand and is expected to be launched by the end of the year, Tangem chief technical officer (CTO) Andrey Lazutkin told Cointelegraph.
Tangem Hardware Wallet Technology Certified by Visa✅️
The new Tangem crypto wallet will support Tangem Pay, a payment technology that allows users to spend cryptocurrency directly from a self-custody wallet through payment terminals or online payment tools. Tangem Pay is based on a smart contract and comes with one card without a seed phrase, Lazutkin said.
This is a significant step towards bringing the traditional banking sector and digital assets closer together, making it easier for everyday users to navigate and benefit from both worlds.
The team recently announced support for tokens created on the #TON network and another 1800+ other cryptocurrencies from different blockchains, allowing you to swap between them through the DEX built into the application.
🛍🛍Easy buy a cold wallet Tangem with a 10% discount promo code: FG7L9X attangem.com
Tangem Core. Reliability. ❤️
✅ Three similar devices offer a second and third chance to recover your assets in case of accidents or loss.
✅ The #Tangem chip is a product of a collaboration with Samsung Semiconductors, Inc. Its incredible performance and reliability.
✅ The chip is fortified against electromagnetic pulses (EMP), electrostatic discharge (ESD), and X-rays, adhering to the stringent ISO 7816-1 standard for security.
✅ The entire wallet is IP69K certified, offering full dust and water resistance. It functions optimally in temperatures between –25°C and +50°C.
✅Tangem devices have an impressive 25-year replacement warranty, reflecting our confidence in their longevity and durability.
✅ As a monolithic device, no components have a shorter lifespan or are vulnerable to damage or hacking.
🛡When it comes to safeguarding your assets, nothing is more crucial than unwavering reliability.🤜
🛍🛍Easy buy a cold wallet Tangem with a 10% discount promo code: FG7L9X at tangem.com
#Safepal#Ledger#Trezor#TON
Tangem Core: Security❤️
What's inside?
✅Certified equipment: The highest level of safety among consumer devices — EAL 6+.
✅Firmware tested twice: First in 2018 by the Swiss company Kudelski Security and again in 2023 by the international laboratory Riscure. Both audits confirmed the absence of vulnerabilities and backdoors in the firmware, which cannot be updated.
✅Open Source Software: Fully transparent and available for review on GitHub.
✅Anti-counterfeit protection: When you activate your wallet, the app verifies the secure element, confirming its authenticity with #Tangem.
✅Private Key Security: Private keys are generated inside the chip when the wallet is activated using a hardware random number generator. No one, including Tangem, has access to these keys.
✅Smart Backup: Three hardware devices instead of one, each providing the same high level of security. No unsafe copies required.
✅Absolute privacy: Your private keys cannot be disclosed under any circumstances.
✅User-controlled access: The wallet is protected by your access code and biometric authentication.
🛡This is what absolute safety means!
🛍🛍Easy buy a cold wallet Tangem with a 10% discount promo code: FG7L9X attangem.com
#Safepal#Ledger#Trezor#TON
OKX DEX — DEX aggregator and cross-chain bridge — now available on Tangem!⚪️
With a new provider — new opportunities:
- Over 1,000,000 new exchange pair options.
- Over 1,500 new tokens available for swap.
- No KYC.
The team is improving the versatility and usability of the Tangem app by integrating more and more providers.
Update your app and start exchanging crypto right now!🔄
🛍 Buy a cold wallet #Tangem with a 10% discountfrom our channel using the promo code:FG7L9X
#safepal#ledger#trezor#ton#okx
OKX DEX — DEX aggregator and cross-chain bridge — now available on Tangem Express!⚪️
With the new provider you can enjoy the following features:
↔️Over 1,000,000 new exchange pair options
↔️Over 1,500 new tokens available for swap
↔️KYC/AML not required🔥
Enjoy the ability to easily exchange crypto between different networks via the new OKX DEX directly in the Tangem app. Swap now!
🛍Buy a cold wallet #Tangem with a 10% discount from our channel using the promo code: FG7L9X
#Safepal#Ledger#Trezor#TON#OKX#DEX