Бывает начинающие в процессе обучения создают файлы с именем модуля который они изучают. В результате на тестовых запусках ничего не работает😱
Всё потому, что появилась коллизия имён. Например, изучаете вы модуль datetime, и создаёте с таким именем файл (ну логично же😄) прямо в рабочей директории.
Потом, при попытке импортировать datetime модуль, из-за приоритета импорта будет импортирован файл из рабочий директории а не оригинальная библиотека. Ведь имя файла это суть имя модуля!
А знаете ли вы, что не все стандартные модули можно так перезаписать? Коллизии имён не подвержены builtin модули. Они всегда стоят на первом месте в приоритете импорта, поэтому их нельзя заменить.
Полный список таких модулей можно посмотреть в списке sys.builtin_module_names.
То есть, вы сломаете весь Python если назовёте свой модуль os или site, но если назовёте time или gc то ничего страшного не случится)))
Тем не менее, никогда не называйте модули уже занятыми именами!!!⚠️
Я всегда рекомендую всем своим файлам делать именной префикс из 2-3 символов. Например я называю свои проекты так:
pw_project_name
pw_ui_tools.py
pw_something/main.py
Либо под ситуацию
tst_scriptname.py
(не "test" чтобы не подхватывал pytest)
dbg_script.py
maya_ui.py
hou_menu_tools.py
И искать проще, и коллизий нет.
#tricks#basic
The sunrays taking;
All the darkness away,
Love taking all hatred away,
Miniature hopes in shapes of stars,
Now subsiding in beautiful destiny,
Happiness taking all the pain away.
In midst the beautiful world,
I laid here,
Breathless,
My sould taken away by you,
My heart given to beat in someones
Else's cage,
My body drifted with fire,
My voice taken away by deafening silence,
My memories now, washed away,
Fading away with new ones.
This is how,
A beautiful day began,
Changing my life,
To be dreadful forever,
In midst the beautiful world,
I laid here as a dead lover.
#tyler#review
She's like a poem,
Waiting to be read.
She's like a song,
Waiting to be sung.
She's like a melody,
Waiting to be heard.
She's like a book,
Waiting to be understood.
She's like a dance,
Waiting to be performed.
She's like a beauty,
Waiting to be cherished.
She's like art,
Waiting to be crafted.
She's you,
Waiting to be found.
She's you,
Waiting to be loved.
She's not just a girl,
She's within all of you,
She resides somewhere inside,
Somewhere the golden rays don't reach,
Somewhere the silver shine doesn't work,
Somewhere in you,
She stays,
Waiting to be acknowledged.
#tyler#review
She's like a poem,
Waiting to be read.
She's like a song,
Waiting to be sung.
She's like a melody,
Waiting to be heard.
She's like a book,
Waiting to be understood.
She's like a dance,
Waiting to be performed.
She's like a beauty,
Waiting to be cherished.
She's like art,
Waiting to be crafted.
She's you,
Waiting to be found.
She's you,
Waiting to be loved.
She's not just a girl,
She's within all of you,
She resides somewhere inside,
Somewhere the golden rays don't reach,
Somewhere the silver shine doesn't work,
Somewhere in you,
She stays,
Waiting to be acknowledged.
#tyler#review
During a dreadful night,
I managed to put up a fight.
Maybe the strong me died,
And weak me survived.
The constant voices in my ears,
Here I am living in my fears.
Like a painful reminder of that night,
Where I lost a outnumbered fight.
Wondering if I am even right,
While holding myself tight.
The night is long dead,
Here my tears still wetting my bed.
That dreadful night,
The cause of my fright.
These thoughts make me shiver,
The fear making me quiver.
My painful screams,
Still haunting my dreams.
Maybe the strong in me died,
And weak me survived.
I haven't given up the fight,
Because I know,
I can still make it right.
#tyler#review
The correspondence of Tyler Robinson, a suspect in the murder of Charlie Kirk, with his transgender lover, with whom he lived, has been published. The name of the roommate is not mentioned.
#correspondence#tyler#robinson#suspect
#Trump#Democrats
👂More on Trump's Ear ⚠️