Ранее я уже упоминал о другой фишке из ˍˍ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
Our #LassaFever situation report for week 1, 2025 has been published.
54 cases have been confirmed and 10 deaths have been recorded across 6 states in Nigeria.
🔗Download, read, and share via https://ncdc.gov.ng/ncdc.gov.ng/themes/common/files/sitreps/1bded1685f8dc4961a169a274be138c2.pdf
Our #LassaFever situation reports for weeks 42, 2024 have been published.
The weekly report provides a summary of the #LassaFever epidemiological situation and response activities in Nigeria.
🔗Download, read, and share via
https://ncdc.gov.ng/diseases/sitreps/?cat=5&name=An%20update%20of%20Lassa%20fever%20outbreak%20in%20Nigeria
Our #LassaFever situation report for week 40, 2024 has been published.
1025 cases have been confirmed and 174 deaths have been recorded across 28 states in Nigeria.
🔗Download, read, and share via
https://ncdc.gov.ng/diseases/sitreps/?cat=5&name=An%20update%20of%20Lassa%20fever%20outbreak%20in%20Nigeria
Our latest #LassaFever situation report shows that 982 confirmed cases and 168 deaths have been recorded in 2024.
This loss of lives is not just a number but a significant loss of a family member, friend, colleague or a seasoned healthcare worker
CEPI vaccines writes on the critical need for a #LassaFever vaccine to control this disease.
🔗
https://cepi.net/lassa-vaccine-urgently-needed-save-thousands-lives
Situation report: https://ncdc.gov.ng/diseases/sitreps/?cat=5&name=An%20update%20of%20Lassa%20fever%20outbreak%20in%20Nigeria
We have published our latest #LassaFever epidemiology data.
Here you can find a summary of all the latest figures in our weekly infographic.🔽
The full report can be accessed via
🔗https://ncdc.gov.ng/diseases/sitreps/?cat=5&name=An%20update%20of%20Lassa%20fever%20outbreak%20in%20Nigeria
Our #LassaFever situation report for week 32, 2024 has been published.
The weekly report provides a summary of the #LassaFever epidemiological situation and response activities in Nigeria.
🔗Download, read, and share via
https://ncdc.gov.ng/diseases/sitreps/?cat=5&name=An%20update%20of%20Lassa%20fever%20outbreak%20in%20Nigeria
Our #LassaFever situation report for week 30, 2024 has been published.
The weekly report provides a summary of the #LassaFever epidemiological situation and response activities in Nigeria.
🔗Download, read, and share via
https://ncdc.gov.ng/diseases/sitreps/?cat=5&name=An%20update%20of%20Lassa%20fever%20outbreak%20in%20Nigeria
Our #LassaFever situation reports for weeks 28 and 29, 2024 have been published.
The weekly report provides a summary of the #LassaFever epidemiological situation and response activities in Nigeria.
🔗Download, read, and share via
https://ncdc.gov.ng/diseases/sitreps/?cat=5&name=An%20update%20of%20Lassa%20fever%20outbreak%20in%20Nigeria
Our #LassaFever situation report for week 25, 2024 has been published.
The weekly report provides a summary of the #LassaFever epidemiological situation and response activities in Nigeria.
🔗Download, read, and share via
https://ncdc.gov.ng/diseases/sitreps/?cat=5&name=An%20update%20of%20Lassa%20fever%20outbreak%20in%20Nigeria
Our #LassaFever situation report for week 24, 2024 has been published.
The weekly report provides a summary of the #LassaFever epidemiological situation and response activities in Nigeria.
🔗Download, read, and share via
https://ncdc.gov.ng/diseases/sitreps/?cat=5&name=An%20update%20of%20Lassa%20fever%20outbreak%20in%20Nigeria
Our #LassaFever situation report for week 23, 2024 has been published.
The weekly report provides a summary of the #LassaFever epidemiological situation and response activities in Nigeria.
🔗Download, read, and share via
https://ncdc.gov.ng/diseases/sitreps/?cat=5&name=An%20update%20of%20Lassa%20fever%20outbreak%20in%20Nigeria
Our #LassaFever situation report for week 21, 2024 has been published.
The weekly report provides a summary of the #LassaFever epidemiological situation and response activities in Nigeria.
🔗Download, read, and share via
https://ncdc.gov.ng/diseases/sitreps/?cat=5&name=An%20update%20of%20Lassa%20fever%20outbreak%20in%20Nigeria