Ранее я уже упоминал о другой фишке из ˍˍ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
#zig
TigerBeetle is a powerful, highly reliable database built specifically for financial transactions, designed to handle huge volumes with safety and speed. It ensures that once a transaction is confirmed, it cannot be lost, even if hardware fails or data gets corrupted. It uses advanced techniques like replication, checksums, and fault-tolerant consensus to keep data safe and available. TigerBeetle is much faster and more efficient than traditional databases, making it ideal for mission-critical financial systems that need to process thousands of transactions per second without errors or downtime. This means you get a secure, fast, and stable platform for managing money transfers and accounts reliably.
https://github.com/tigerbeetle/tigerbeetle
#zig
Ghostty is a fast, feature-rich terminal emulator that combines speed, native platform integration, and modern features without compromise. It supports multi-window, tabs, and split panes, with GPU-accelerated rendering using Metal on macOS and OpenGL on Linux for smooth performance. Ghostty is highly compatible with existing shells and software, making it a drop-in replacement. It offers rich theming, ligature support, and advanced developer features that enable more interactive command-line applications. Its native UI and cross-platform design provide a polished, efficient terminal experience that enhances productivity and usability for both users and developers.
https://github.com/ghostty-org/ghostty
🔥GEM ANNOUNCEMENT🔥
#ZIG/USDT:
Spot Signal (Exchange: Bybit, Bitget, MEXC, Gate.Io)
Technical Analysis:
#ZIG is pumping exactly from the support zone and now breaking a resistance trendline. We can see bullish momentum in it right now because technically this coin looks very strong. You people can buy and hold it now because bull run is going on and we can get good profits in it
📢BURN INCOMING📢
It's time to buyback & burn #ZIG🔥🔥!
8th Monthly #ZIG buyback & burn will take place on 6th January and It will be the biggest monthly burn to date!
#Zignaly#ZIG#Burn
#zig#3d_game#cubyz#game#procedural_generation#sandbox#sandbox_game#voxel#voxel_game#zig
Cubyz is a 3D voxel sandbox game like Minecraft, letting you explore unlimited height and depth with far view distances. It has a unique crafting system where you can try making any tool, and the game figures out what it is. It runs on Windows and Linux, written in the Zig programming language for better performance. You can easily download and run it or compile it yourself if you want the latest version. The game is open-source, so you can contribute by adding code, gameplay features, or textures following simple guidelines. This means you get a flexible, creative game with ongoing improvements and community support.
https://github.com/PixelGuys/Cubyz