Ранее я уже упоминал о другой фишке из ˍˍ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
Facades for the OPPO Super Flagship Store.
Bamboo inspired the facade design for the OPPO Super Flagship Store in the city of Guangzhou.
An important source of food, clothing, housing, and transportation for people in Guangzhou in ancient times, the design adds a contemporary twist to the vernacular architecture of the city.
Photos: CreatAR images
Architecture: UnStudio
#unstudio#benvanberkel#materialmonth#architecture#facadedesign#arch_shovel
Do you know how many silver spheres are on the facade of the Hanjie Wanda Square in Wuhan, China?
42,333.
While they all may look identical, their specific positions involving each other recreate the effect of movement and reflection in water or the sensuous folds of silk fabric.
Photos: Edmon Leong / UNStudio
#unstudio#facades#facadedesign#architecture#retaildesign#lightingdesign#arch_shovel
Can you guess what inspired Unstudio architecture’s design for the facade elements of the Shenzhen Maritime Museum?
Comment your answer below!
#unstudio#ceramicdesign#facadedesign#worldmuseums#museumsoftheworld#museumdesign#architecture#architecturaldesign#arch_shovel
Flexibility has become more important to people today than sheer size.
With the design for Van B UnStudio introduce new ways to make the footprint of an apartment more flexible — challenging old conventions of square footage and fixed footprints.
The architectural strategy was to devise as many different ways as possible to reconfigure an apartment. To achieve this, architects designed a ‘plugin-based’ system that allows homeowners to use the space in a 40m2 apartment almost as if it were a 60m2 loft.
This allows you to easily change the use of the same floor space in a matter of seconds, making it possible to transform a room from a generous office into a cozy living room, or a bedroom.
Renders: Bauwerk / bloomimages
#unstudio#housing#modularhousing#modularity#flexibility#inclusivedesign#germandesgin#sustainability#greenarchitecture#arch_shovel