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

Резултати

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

Пребарај: #sentinels

当前筛选 #sentinels清除筛选
NewUU Student Council

@newuu_sc · Post #671 · 23.06.2023 г., 11:35

📢 Election Update: Renaissance Team Emerges Victorious!🎉 We are thrilled to announce the conclusion of the Student Council elections, held online through Google Forms from June 20 to 22. After an intense battle for leadership, the results are finally in! ✨ Team Renaissance has emerged as the winner, securing an impressive 59.3% of the votes! 🎊 We extend our warmest congratulations to their members for their outstanding campaign and commitment to making a positive impact on our school community. 🏅 We also commend the Sentinels team for their dedication and hard work, as they garnered a respectable 40.7% of the votes. Your participation and contributions have been invaluable throughout this process. We would like to express our gratitude to all candidates who put themselves forward for the Student Council elections. Your passion, ideas, and willingness to serve are truly commendable. A special thanks goes out to every student who participated in the voting process. Your engagement and enthusiasm have played a crucial role in shaping the future of our Student Council and the initiatives it will undertake. Let us now join hands and offer our full support to the Renaissance Team as they embark on their journey of leadership. Together, we can strive to create an inclusive and vibrant school environment that fosters growth, innovation, and collaboration. Best Regards, Student Affairs. 🎓🌟#StudentCouncilElections#Renaissance#Sentinels#Congratulations

NewUU Student Council

@newuu_sc · Post #639 · 14.06.2023 г., 09:06

📢 Attention all students of New Uzbekistan University! 🎓 The highly anticipated debates between the two candidates vying for the position of President of the Student Council will take place in the university Conference Hall. 🎙🏛 Join us for an engaging discussion as these candidates present their visions, plans, and goals for the next academic year. It's an excellent opportunity to get to know the potential leaders who will shape our university's future! 🌟✨ Whether you're passionate about academic improvements, extracurricular activities, or enhancing student welfare, this debate is the perfect platform to hear the candidates' perspectives and evaluate their abilities to meet our diverse needs. 📚🎉 Spread the word and see you all there! 🎉🗣 Date: June 16 Time: 16:00 Location: Conference hall #NewUzbekistanUniversity#StudentCouncilElections#Debate2023#Renaissance#Sentinels