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

TGINSIGHT SIMILAR POSTS

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

Изворен канал @pythonotes · Post #199 · 8 јан.

Многие из тех кто активно работал с Python2 несколько удивлены, почему в Python3 удобная функция reload() переехала из builtin в imp а потом и в importlib? Ну было же удобно! А теперь лишний импорт😖 Дело в том, что начиная с Python3.3 функция reload() переписана на Python вместо Cи. Что это нам даёт? 🔸 Такой код проще поддерживать и развивать 🔸 Python код легче читать, изучать и понимать. Сравните это ➡️ и это ➡️. 🔸 Как результат пункта 2, проще писать свои расширения импорта. Например, пользовательский импортёр с какой-либо хитрой логикой по аналогии с импортом из zip архивов. А есть ли у этого решения недостатки? Да, они всегда есть. 🔹 Так как это не builtin функция, её следует импортнуть перед использованием 🔹 Скорость замедлилась примерно на 5%. Очевидно, что это совершенно не критично. К тому же от версии к версии логика импорта будет оптимизироваться и ускоряться. В самом начале файла importlib/__init__.py мы видим такой импорт: import _imp # Just the builtin component, NOT the full Python module То есть часть функционала по прежнему написана на Си, но достаточно низкоуровневая. #basic

Hashtags

Резултати

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

Пребарај: #healthyhabits

当前筛选 #healthyhabits清除筛选

#WellnessWednesday: Stay Active. Stay Healthy! 💪🏾 Staying active doesn’t always require a gym membership, sometimes it’s the little things that make the biggest impact! 🚶🏾‍♀️‍➡️ Take the stairs instead of the elevator walking 🙆🏾‍♀️ Stretch during work breaks 🗣️ Engage in quick walks or light conversations with colleagues 🧍🏾‍♀️Stay on your feet while prepping meals or organizing your space These simple movements can help reduce stress, improve mood, boost focus, and support your overall health. Whether you’re at home or at work, every step counts! #Wellnesswednesday#NCDCNigeria#HealthyHabits

#FactFriday: Good Food, Good You! 🥬🥦Adding more fruits and vegetables to your meals can be a game changer for your health. They are filled with Vitamins, Minerals and fiber that helps boost your immunity, Protect your heart and lower the risk of chronic diseases. Healthy eating starts with fruits and Vegetables✅️ #FactFriday#HealthyLiving#HealthyHabits#NCDCNigeria.

#Healthtiip Monday: Clean hands, Healthy You! 💦Regular handwashing with soap under running water or using an alcohol-based sanitizer is one of the most effective ways to protect against infectious diseases, including Ebola. In times of outbreaks, this simple habit can make a big difference. ✅ Every wash helps to break the chain of transmission and keep you, your loved ones, and your community safe. #HealthTipMonday#HealthyLiving#HealthyHabits#NCDCNigeria