Pythonista Modify Standard Library? #27
-
|
Hi all, I've recently gotten back into coding as a hobby, and I'm working on a mini project just to get back into the swing of things. For the project, I created a dictionary with a word for each letter using the NATO phonetic alphabet, but the variable declaration is long, annoying, and bloats the file. So I was wondering if there was a way to actually move that dictionary to the default package "string". It would be useful to be able to access in the future as well. If not, is there a way to "overwrite" the string package? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
You can't modify the built-in standard library, but modules in the user |
Beta Was this translation helpful? Give feedback.
You can't modify the built-in standard library, but modules in the user
site-packagesfolder (under Python Modules) will take precedence over modules in the built-in standard library, so you could put a copy of a standard library module there to "replace" (override) a built-in module.