Вторая по частоте 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
❗Объем торгов на ITS в июне составил $11,9 млн
Объем торгов акциями и депозитарными расписками на международной торговой площадке ITS по итогам июня составил $11,9 млн. Общее количество сделок с акциями и депозитарными расписками международных компаний составило 2795 сделок.
В топ-10 лидеров по объему торгов вошли акции Tesla, Marathon Digital Holdings, AMD, Coinbase Global, Exxon Mobil Corporation, Baidu, Virgin Galactic Holdings, MicroStrategy Incorporated, Li Auto, JD.com.
Торги стартовали 7 июня 2023 года и с первого дня инвесторам стали доступны 1570 акций и депозитарных расписок компаний из США, Европы и Азии с первичным листингом на американских биржах NYSE и NASDAQ.
#торги
#ITS
i get that people are more comfortable with defined rules and structure but i also think queer people lost when they started resorting to dictionary definitions for what labels mean
the queer umbrella is meant to deviate from the norm of rigid boxes and definitions and to decide that lesbian means Only this, bi means Only this, etc, is directly contradicting what queer means. each and every label is going to have a unique meaning to the person using it and that is how it’s supposed to be. if you’re not comfortable with that…sorry?
basically if someone tries to tell you you’re using a label wrong:
[image description: a set of tumblr tags from @/elinaline, reading: “#there is a way to use a label wrong actually; #its when you force it on someone else”. end image description.]
this is the only answer i’ll accept thank u everyone for your participation <3
https://genderkoolaid.tumblr.com/post/689713705918791680
i get that people are more comfortable with defined rules and structure but i also think queer people lost when they started resorting to dictionary definitions for what labels mean
the queer umbrella is meant to deviate from the norm of rigid boxes and definitions and to decide that lesbian means Only this, bi means Only this, etc, is directly contradicting what queer means. each and every label is going to have a unique meaning to the person using it and that is how it’s supposed to be. if you’re not comfortable with that…sorry?
basically if someone tries to tell you you’re using a label wrong:
[image description: a set of tumblr tags from @/elinaline, reading: “#there is a way to use a label wrong actually; #its when you force it on someone else”. end image description.]
this is the only answer i’ll accept thank u everyone for your participation <3
https://genderkoolaid.tumblr.com/post/689713705918791680