Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #95224 > unrolled thread
| Started by | Chris Angelico <rosuav@gmail.com> |
|---|---|
| First post | 2015-08-11 02:08 +1000 |
| Last post | 2015-08-11 02:08 +1000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Importing is partially working... Chris Angelico <rosuav@gmail.com> - 2015-08-11 02:08 +1000
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2015-08-11 02:08 +1000 |
| Subject | Re: Importing is partially working... |
| Message-ID | <mailman.45.1439222936.3627.python-list@python.org> |
On Tue, Aug 11, 2015 at 1:48 AM, MRAB <python@mrabarnett.plus.com> wrote: >> You're almost there! But in Python, you don't import something from a >> specific file - you import from a module, and the Python interpreter >> is free to locate that file anywhere that it can. It might be >> implemented in C, and be stored in Functions.so (on Unix-like systems) >> or Functions.dll (on Windows); it might be precompiled and loaded from >> Functions.pyc; it might come from a zip file, or some other form of >> special import source. So all you say is: >> > On Windows, the extension for Python extension DLLs is ".pyd". Or that. I haven't built any Python extensions in, well, ever, and haven't even deployed other people's in years, so I'm a bit rusty. Anyway, point is you don't have to care where it actually comes from. The one thing that I do kinda miss in Python is an easy way to "shadow and pull in the original" - to create something earlier in the search path, but then have that file get a reference to "the module that would have been loaded if I hadn't been here". It's not often you want it, but quite frankly, I don't know how I'd spell it at all. There probably is a way, but I've no idea what it is... ChrisA
Back to top | Article view | comp.lang.python
csiph-web