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

TGINSIGHT SIMILAR POSTS

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

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

Подразумеваемые неймспейсы или неявные пакеты. Этот функционал добавлен в Python 3.3 Что он означает? Ранее, до 3.3 пакетами считались лишь директории, в которых есть файл __init__.py. Этот файл одновременно являлся свидетельством того, что директория это Python-пакет, и служил "телом" этого пакета. То есть местом, где можно написать код, как это делается внутри модуля. Этот код исполняется в момент импорта пакета, так что его принято называть "код инициализации пакета". Начиная с версии 3.3 Любая директория считается пакетом и Python будет пытаться использовать любую директорию для импорта. Конечно, не любую в файловой системе, а только те что находятся в sys.path. Это значит, что теперь __init__.py нужно делать только если: 🔸 вам требуется создать код инициализации пакета 🔸 нужна совместимость со старыми версиями Python На мой взгляд это немного упрощает разработку, делает её чище, но с другой стороны убивает некоторую однозначность происходящего. Например, я создал репозиторий со своей библиотекой и рядом положил код примеров или тестов. repo_name/ my_library/ __init__.py main.py examples/ exam1.py exam2.py В этом репозитории пакетом является только my_library, остальные директории это не пакеты, это просто дополнительный код в файлах. Директория examples не добавлена в sys.path, в ней нет рабочих модулей. Но если она лежит рядом с my_library, то Python вполне сможет импортнуть из неё модули, так как посчитает что examples это валидный пакет. Конечно, пример несколько надуманный. Никто не будет добавлять корень репозитория в sys.path. Но, я думаю, суть ясна. Иногда директория это просто директория а не пакет! #basic#pep

Hashtags

Резултати

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

Пребарај: #piyush

当前筛选 #piyush清除筛选
Pensive|

@PensivePost · Post #5015 · 23.03.2021 г., 10:41

When I was old I'd never chase peace, Now I can't live without this. When I was old I never thought I'll miss, Now everything is temporary still I seek. Used to cry when someone leaves me alone, Now me, myself and I love to stay at home. Used to cry when someone shows me the ghost, Now I don't know how to cry every day I see the living ghost in the people. I always live with the right people, who might care! If anybody wants to prove me wrong, I say “I think you are right there”. Don't let the world falls you down, you're doin alright, damn! #review#piyush

Pensive|

@PensivePost · Post #5001 · 15.03.2021 г., 09:59

Baby you can't ruin all the beautiful things Stop doing all these suitable mood swings Why did you think, That way. Sometime mind fucked up And the heart has to pay. I don't want to hate you Please don't make me to say it. We should forget bout us And shall pretend like we don't remember each other name. You were behind the fame and I understand. I was in pain but You didn't understand. #piyush#review

Pensive|

@PensivePost · Post #5013 · 22.03.2021 г., 10:27

Your world what was so busy So I left alone and that wasn't easy Our love didn't leave any meaning Then I called you and you keep it on ringing Now my heart can't stop singing My mind can't stop thinking 'Bout you I thought my friend would leave me, but not you I hope you too wanted the same thing Love, lust and fam thing Our future is now too far Am I blind? Why don't I can't see? Can't see, can't see, can't see.. ? Anymore.. Don't know 'bout those First, they love and then leave What made you by leaving them broke? #piyush#poetry#review

Pensive|

@PensivePost · Post #4878 · 06.02.2021 г., 14:27

Spectrum of love I had once affected from love We were one, now it's just get separate by move No one tried to prove Now we aren't into.., Love. But still checking up on each other's. Maybe we still don't want to get lose That was best life, when I had choose.., Her. Now it's getting worse and I can't do.., Anything. Stucked up on penny things, You and me had fucked up everything. Me and her, had dreams. It was fucked up ever since. #review#piyush#verse

Pensive|

@PensivePost · Post #4872 · 04.02.2021 г., 18:06

Why it's feels so alone? Maybe cause of I didn't hear my fav songs It's night and it's so dark It's feeling like I'm lost When this night will end? Stop living in my head! What if I stay calm? And what if you stay with me? There are thousands of words to say And you are not here to listen to me One day you would come at any reason for me And one day I'll be gone for many reasons and you won't see that coming.. #review#piyush#verse

Pensive|

@PensivePost · Post #4862 · 03.02.2021 г., 11:11

She just want to be alright, Even things are not all right, She's now crying like all night, She chooses darkness so she lose light. Now even god wants to know, who's right ? I didn't do anything wrong and idk if I have did maybe, No one knows how much I need you my baby, Again! You left me but when will this pain? You got yourself outta my life and I'm still in that lane. Sometime true love dies and no one gives a damn, Tell me after broking me what did you gain? #review#piyush#verse

Pensive|

@PensivePost · Post #4856 · 02.02.2021 г., 17:17

She cried and said “why you want to control me?” I cried and said “it doesn't make me lonely.” She said is love isn't there to make we us? I said that's right but what bout lust? She still think that I was hiding something And than she left me saying you share nothing Now she miss me too Losing controlling too She thought I was fake But now who left true? #verse#review#piyush

Pensive|

@PensivePost · Post #4966 · 27.02.2021 г., 19:37

She was drunk and lonely Alone in the city maybe that's why she don't know me Writing bout her maybe that's made her know me Hooked up with her cause she was horny She didn't said any word but when I left she said wish you'd met me before I just saw in her eyes and felt like she want more Her body wanting me but she couldn't said any word Maybe she don't want to get addict or maybe she don't want to do this anymore Her weight was much heavy but at that time, I made her feel low She said wanting this so hard, waiting from the months Tell me how you get good at this ? now I can't satisfy at once I just started from removing clothes and slowly her body started gettin burn Pleasure come with pain though but she was having fun Leg was stucked with her pants but it looks like she wanted to run Or maybe she wanted the one who won't run and drive her crazy And later, she found me and I found her, no one is between us (Erotic breathing and saying) 'Amazing'. #review#piyush#fictionalstory

Pensive|

@PensivePost · Post #4855 · 02.02.2021 г., 17:05

She cried and said “why you want to control me?” I cried and said “it doesn't make me lonely.” She said is love isn't there to make we us? I said that's right but what bout lust? She still think that I was hiding something And than she left me saying you share nothing Now she miss me too Losing controlling too She thought I was fake But now who left true? #review#verse#piyush#pease