Ранее я уже упоминал о другой фишке из ˍˍ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
RESIDENTIAL BLOCK.
Basis team helped the developer to increase the usable area of the yard and create an unusual comfortable place for people. We have developed a multi-level design. At the lower level there are all the basic functions: children’s and sports grounds, recreation areas. At the middle level we designed an amphitheater for parents around the playground and a co-working space for outdoor work, which can be used as a cinema in the evening. The upper level serves as a canopy from rain and direct sunlight for the lower levels.
There are tables for games of chess, kicker and sea battle. After the game, you can relax outdoors in the lounge area or with your neighbors at the community table.
#arch_shovel#architecture#archdaily#residential
The project of a new residential complex in Moscow was approved.
The main design element is small balconies, which resemble a skin of the fantastic animal.
Architecture: “LABVA PRO” LTD bureau and “Architectural Bureau of Katerina Gren”.
#arch_shovel#architecture#moscow#residential#complex#new#NewsArchitecture
Sutton Tower at 430 East 58th Street.
A beautiful Bavarian limestone residential tower designed by visionary architect Thomas Juul-Hansen, situated in New York City's most sophisticated and enduring enclave, with epic views of the city, East River and the Ocean.
Rendering by Recent spaces
Designed by Thomas Juul Hansen
Branding by Pandiscio green
Sales & Marketing by Corcoran Sunshine
#manhattan#architecture#archdaily#buildings#newbuildings#residential#nyc#newdevnyc#rendering#arch_shovel