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

Резултати

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

Пребарај: #ilva

当前筛选 #ilva清除筛选
Ultimora.net - POLITICS

@ULTIMORAPOLITICS · Post #42198 · 17.11.2022 г., 12:56

È terminato al ministero delle Imprese e del Made in Italy il tavolo sull'ex #Ilva convocato dal ministro Adolfo #Urso in merito alla sospensione delle attività fino al 16 gennaio 2023. @UltimoraPolitics

Hashtags

Maurizio Vezzosi

@mauriziovezzosi · Post #118 · 30.11.2019 г., 15:20

Il mio - altro - videoracconto della giornata della manifestazione che si è svolta ieri a Taranto. Per Ruptly. Taranto (Italy) 29th november 2019 - Hundreds of Ilva workers, Europe's largest steel plant owned by the French-Indian multinational Arcelor-Mittal, held a general strike in Taranto on Friday, to protest against the company's plans to layoff thousands of workers as well as the toxic waste the plant has spewed over the city. "As has always been the case, we demand two basic rights that are written in our Constitution; the right to work and the right to the health," Vincenzo Mercurio a worker and a trade union delegate said. Reports say the protest was joined by a large number of students and activists associated with 'Fridays for Future' and 'Youth for Climate' groups. "The reason why we, students and citizens, are protesting is that we are tired of speaking with people that refuse to respect our rights and to listen to us; people that are busy worrying about their interests, not the people's ones. And we are tired of people showing that they are representing us, although they are just trying to gain our votes," Sara Pierpoli a student and protester said. The Italian government and the world's largest steelmaker Arcelor-Mittal are in dispute over pollution levels and the company's legal position while Rome is considering options to keep the plant open and save thousands of jobs. Video and text by Maurizio Vezzosi #steel#ilva#italsider#italy#climatestrike#fridayforfuture#strikeforclimate https://youtu.be/7xS2zjstqKs

Maurizio Vezzosi

@mauriziovezzosi · Post #116 · 29.11.2019 г., 17:10

#Taranto. I lavoratori del polo siderurgico ex-Ilva (ex-Italsider) scioperano con un'adesione sopra al 70% e scendono in piazza insieme ai giovani per l'ambiente, la salute, il lavoro: una battaglia per l'#Italia contro i saccheggi delle multinazionali. Il mio video-racconto per Il Fatto Quotidiano. #acciaio#ilva#italsider#iri#climatestrike#fridayforfuture#strikeforclimate