Вторая по частоте future-функция, которую я использовал, это абсолютный импорт
from __future__ import absolute_import
Что она делает?
Изменения, которые вносит эта инъекция описаны в PEP328
Покажу простой пример.
Допустим, есть такой пакет:
/my_package
/__init__.py
/main.py
/string.py
Смотрим код в my_package/main.py
# main.py
import string
Простой пример готов) Вопрос в том, какой модуль импортируется в данном случае? Есть два варианта:
1. модуль в моём пакете my_package.string
2. стандартный модуль string
И вот тут вступает в дело приоритет импортов. В Python2 порядок следующий: помимо иных источников, раньше ищется модуль внутри текущего пакета, а потом в стандартных библиотеках. Таким образом мы импортнём my_package.string.
Но в Python3 это поведение изменилось. Если мы указываем просто имя пакета, то ищется именно такой модуль, игнорируя имена в текущем пакете. Если мы хотим импортнуть именно подмодуль из нашего пакета то, мы должны теперь явно это указывать.
from my_package import string
или относительный импорт, но с указанием пути относительно текущего модуля main
from . import string
Еще одной неоднозначностью меньше 😎
Подробней про импорты здесь:
https://docs.python.org/3/tutorial/modules.html
#2to3#pep#basic
#TakeResponsibility
If you observe any of these signs and symptoms, visit a healthcare facility for an accurate diagnosis and treatment.
Ensure you take extra precautionary measures while visiting to prevent the risk of spread.
Fake news can cause unnecessary anxiety and panic. PAUSE, and verify before you share!
Citizens are urged to take the recommended actions required to protect their families, friends, and selves.
🔗
https://ncdc.gov.ng/news/493/official-statement-on-the-new-covid-19-subvariants
#TakeResponsibility
Seek the advice of a qualified healthcare professional when you feel sick.
Self-medication can be harmful.
#TakeResponsibility by using antimicrobials appropriately
Seek the advice of a qualified healthcare professional when you feel sick.
Self-medication can be harmful.
#TakeResponsibility by using antimicrobials appropriately
Meningitis can affect any age group but is more common in children and young adults.
Visit a health center facility for immediate attention if you observe any of the below symptoms.
#TakeResponsibility to stay safe
Drugs save lives, however, they can harm when not taken properly.
Using drugs “anyhow” makes the treatment of infections more difficult.
Visit a healthcare professional when sick for accurate diagnosis and treatment.
Do not self-medicate!
#TakeResponsibility
Parents & caregivers should ensure that their children/wards receive the anti-diphtheria vaccine as recommended in the NPHCDA childhood immunisation schedule.
Visit a primary health care centre close to you to get the vaccine.
#TakeResponsibility
Parents & caregivers should ensure that their children are fully vaccinated against diphtheria with three (3) doses of the pentavalent vaccine as recommended in the childhood immunisation schedule.
#TakeResponsibility to protect yourself & loved ones
🔗
https://ncdc.gov.ng/news/435/diphtheria-public-health-advisory-amidst-outbreak-in-nigeria
The elderly, immunocompromised and those with existing health concerns are advised to:
➡️Wear face masks in outdoor spaces
➡️Wash hands regularly with clean water and soap
➡️Use hand sanitisers
➡️Avoid large gatherings
#TakeResponsibility to stay safe and healthy.
A clean environment and proper hygiene limit the spread of infectious diseases.
Clean all surfaces frequently and do not share personal items.
#TakeResponsibility to protect yourself and your loved ones.
To protect yourself and loved ones from Ebola virus disease, #TakeResponsibility:
✅Wash your hands using soap and running water
⛔Avoid direct handling of dead bats, monkeys etc
⛔Avoid physical contact with anyone with undiagnosed symptoms
📜Advisory
https://ncdc.gov.ng/news/423/public-health-advisory-following-declaration-of-ebola-virus-disease-outbreak-in-uganda
ДжоПи:
Как найти вопрос, на который не знаешь ответа?
Это как найти шапку, которую уже надел,
Но забыл об этом.
Как пристроить ответ, на который не задан вопрос?
(У меня их столько за жизнь заготовлено.)
Как снежков налепить в одиночку,
а не в кого бросить.
Вот прибрался в комнате,
и день прошёл.
А план не изменился.
#bitnev#стихи#takeresponsibility