Вторая по частоте 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
Gatto Channel: June Events Calendar
#calendar#events
Gatto | Official Channel (18+) has released a calendar of regular events for June. Collaborations, raffles, and secret events are not listed, requiring subscribers to stay tuned for further announcements.
Source: link
@tonlines
In 46 BC, Julius Caesar added 90 extra days to the year, making it 445 days long. This was done to fix the calendar’s drift from the solar year. The previous calendar was out of sync with the seasons. Caesar introduced the Julian calendar, which included leap years every four years to keep the calendar aligned with the sun.
📅🔧
[Read more]
@googlefactss
#History#Calendar#LeapYear
🌍 Samoa famously skipped December 30, 2011, to switch from the eastern to the western side of the International Date Line. This move aligned its calendar with Australia and New Zealand. ✨
#Samoa⚡#dateline⚡#calendar⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
📅 Calendar Stickers 📅
https://telegram.me/addstickers/Calendar2016
#Calendar#Useful#Hacks
🛠 It could be useful (or even some sort of a lifehack) for users.
Fokus
To Do app tailored specifically for #students
Fokus is an open source application that combines a #todo list and a #calendar that can help you manage your #school related #work and #events in one place. It's fast and beautiful yet simple design that can help you focus on what matters most.
Features:
• Get reminded when a task is nearing its due
• Get reminded about incoming events
• Add attachments to your tasks
• Persistent notifications for important tasks or events
• No ads or any tracking
• Open Source Code
• On-Device Database
Download: https://github.com/icabetong/fokus-android/releases/
https://github.com/icabetong/fokus-android
@foss_Android