TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #60 · 31 мар.

Вторая по частоте 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

Резултати

Пронајдени 156 слични објави

Пребарај: #idiom

当前筛选 #idiom清除筛选
English From Zero to Hero

@Learn_English_from_Zero_to_Hero · Post #60511 · 18.11.2025 г., 16:22

#Idiom 💢Go off on a tangent Or 💢 Go off at a tangent 🔰If a person or piece of writing goes off on a tangent or goes off at a tangent, they start saying or thinking something that is not directly connected with what they were saying or thinking before 💠Note:- In geometry, a tangent is a straight line which touches a curve at one point 🕸 Ex:- Our teacher would occasionally go off on a tangent and start talking about something totally unrelated to the textbook. 💠Note:- You can use other verbs instead of go 🕸 Ex:- The book's theme wandersoff on a tangent now and then.

Hashtags

English From Zero to Hero

@Learn_English_from_Zero_to_Hero · Post #59847 · 03.07.2025 г., 21:40

#Idiom 🕸People in society🕸 ❄️A self-made man ♣️ A person who is rich and successful because they have worked hard, not because they were born into a rich family ❄️The chattering classes ♣️ Educated people who enjoy discussing social, political and cultural issues ❄️A second-class citizen ♣️ Someone is treated as if they are less important than others in society ❄️The grass roots ♣️ Ordinary people in a political or sporting organisation, not the leaders ❄️ The silent majority ♣️ A large number of people who do not express their opinions publicly ❄️ The (men in) grey suits ♣️ People in business or politics with a lot of influence or power, although they are not well known to the public ❄️Public enemy number one ♣️ Smth or someone that a lot of people dislike or disapprove of ❄️New kid on the block ♣️ Someone who is new in a place or organisation and has many things to learn about it (informal).

Hashtags

English From Zero to Hero

@Learn_English_from_Zero_to_Hero · Post #59742 · 15.05.2025 г., 05:36

#Idiom 💢Even exchange: a trade of equal value; when you return something and take something else that costs the same price ✨ Ex: If you return that jacket and get this sweater instead, it will be an even exchange. They're both $39.99.

Hashtags

123•••10•••1213
ПретходнаСтраница 1 од 13Следна