Вторая по частоте 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
https://descubreenmexico.com/por-que-la-semana-santa-cambia-cada-ano-de-fecha/
#SemanaSanta
Este mes de abril muchos mexicanos y cristianos celebran la Semana Santa, es decir, la conmemoración anual de la Pasión de Cristo.
¿Qué es la pasión de Cristo?
Esta semana relata la entrada de Jesús a Jerusalén, su última cena, el viacrucis, su muerte y resurrección.
¿Cuándo es la Semana Santa este año?
Este año, la Semana Santa se celebra desde el domingo 24 de marzo hasta el domingo 31 de marzo.
¡Ardor para la fachiza!
El #AIFA sigue ganado visitantes nacionales e internacionales.
A la derecha no le gusta saber que México avanza, por eso inventan historias de fracasos.
#SemanaSanta#AIFA
¡Atención! ☝🏻
🔴 El gobierno de #DelfinaGómez (@delfinagomeza) llamó a la población a evitar el uso de fogatas y pirotecnia en zonas forestales durante el periodo vacacional de #SemanaSanta🌳🪵👇🏻
https://revistaelpolitico.com/estados/gobierno-del-edomex-pide-proteger-bosques-semana-santa/
"Mucho amor y buenas vacaciones" ❤️🌴
🔴 A través de un video desde #PalacioNacional, #Sheinbaum envió un mensaje a mexicanos por #SemanaSanta e informó cuáles son sus planes para estos días 👩🏻📹
¡Hay que presumirlo! 😎
La presidenta #Sheinbaum echa abajo el montaje de #FedericoDöring🤡
‼️Esta #SemanaSanta el AIFA tuvo 64 mil 525 pasajeros en 1,233 vuelos ✈️
¡Aunque no le guste a los prianistas! 😌
Le darán su #SemanaSanta al Tío Richie 😅
🔴 La #SCJN discutirá la próxima semana dos proyectos que, de validarse, representarán un nuevo golpe legal a #SalinasPliego👊🏻💰
https://sinlineamx.com/scjn-alista-doble-reves-legal-contra-grupo-salinas/
In Spain, Good Friday is part of Semana Santa (Holy Week). Cities hold large religious processions.
Groups called brotherhoods organize these events. People wear long robes and pointed hoods. They walk slowly as an act of penance.
Huge floats called “pasos” show scenes from the crucifixion of Jesus. These can weigh over a ton and are carried by teams underneath.
Some cities have music with drums and bands. Others stay completely silent. People also sing emotional songs from balconies.
In Seville, processions can last all night. In Málaga, there is a tradition of pardoning a prisoner. In Valladolid, old sculptures from the 16th and 17th centuries are used.
Traditional foods include torrijas and buñuelos.
🇪🇸🕯️🎭🥁
[Read more 1]
[Read more 2]
@googlefactss
#GoodFriday#SemanaSanta#Spain#Traditions#History#Culture