On 8/9/23 17:28, dn via Python-list wrote:
Side note: Using "...import identifier, ..." does not save storage-space
over "import module" (the whole module is imported regardless, IIRC),
however it does form an "interface" and thus recommend leaning into the
"Interface Segregation Principle", o
for a bit more thought, looking at PEP8, we notes about imports,
but sadly PEP8 does not state which method is better/preferred. While
obviously in the end, it's always the maintainers choice in what they
prefer, so are tabs vs spaces and PEP8 is opinionated about that too
(in a good way,
On 09/08/2023 22.30, Oliver Schinagl via Python-list wrote:
...> Looking at a python projects code and repository layout, we see the
following directory structure.
/project/core
/project/components/module1
...
/project/components/moduleN
/projects/util
...> Some modules import other modules, an
Dear list,
First a disclaimer, I am a python novice ;) so apologies beforehand for
any incorrect terms and use thereof :)
I have a question about the preferred/pythonic way dealing with imports.
But let me start by giving a little bit of an example (which lead me to
this question
y original question. Now it is
about the long and short of it.
-Original Message-
From: Python-list On
Behalf Of Thomas Passin
Sent: Thursday, January 19, 2023 9:37 PM
To: python-list@python.org
Subject: Re: Improvement to imports, what is a better way ?
On 1/19/2023 7:33 PM, avi.e.gr...
otatochowder.com
Sent: Thursday, January 19, 2023 1:30 PM
To: python-list@python.org
Subject: Re: Improvement to imports, what is a better way ?
On 2023-01-19 at 12:59:21 -0500,
Thomas Passin wrote:
Well, it's an art, not a science [...]
+1
# Create a plot
g2 = (
ggplot(df2,
is package would change to conform but it is a bit late! LOL!
Avi
-Original Message-
From: Python-list On
Behalf Of 2qdxy4rzwzuui...@potatochowder.com
Sent: Thursday, January 19, 2023 1:30 PM
To: python-list@python.org
Subject: Re: Improvement to imports, what is a better way ?
On 20
On 19Jan2023 07:34, Dan Kolis wrote:
On Thursday, January 19, 2023 at 12:09:02 AM UTC-5, cameron wrote:
I know this is vague. Once you find its stalling in a particular
function (if it is) you may be able to run that function directly. Also,
a print() at the top abd bottom/return of the stallin
On 1/19/2023 1:30 PM, 2qdxy4rzwzuui...@potatochowder.com wrote:
On 2023-01-19 at 12:59:21 -0500,
Thomas Passin wrote:
Well, it's an art, not a science [...]
+1
# Create a plot
g2 = (
ggplot(df2,
aes('Days Since Jan 22', # Comments can clarify these params
+ geom_point
2qdxy4rzwzuui...@potatochowder.com schreef op 19/01/2023 om 19:30:
> The PEP-8 rules are good, but they can't cover all cases perfectly.
Some the PEP-8 rules are debatable. Regardless, they can't cover all
cases perfectly. (IOW, we agree on the bit that's relevant to this
thread.)
PEP 8 even
On 2023-01-19 at 12:59:21 -0500,
Thomas Passin wrote:
> Well, it's an art, not a science [...]
+1
> # Create a plot
> g2 = (
> ggplot(df2,
> aes('Days Since Jan 22', # Comments can clarify these params
> + geom_point(size=.1, color='blue') # size, color params optional
>
On 1/19/2023 11:55 AM, Roel Schroeven wrote:
Op 19/01/2023 om 11:32 schreef Stefan Ram:
dn writes:
>The longer an identifier, the more it 'pushes' code over to the right
or >to expand over multiple screen-lines. Some thoughts on this are
behind >PEP-008 philosophies, eg line-limit.
Raymo
Op 19/01/2023 om 11:32 schreef Stefan Ram:
dn writes:
>The longer an identifier, the more it 'pushes' code over to the right or
>to expand over multiple screen-lines. Some thoughts on this are behind
>PEP-008 philosophies, eg line-limit.
Raymond Hettinger (transcribed, shortened and parti
On Thursday, January 19, 2023 at 12:09:02 AM UTC-5, cameron wrote:
> I know this is vague. Once you find its stalling in a particular
> function (if it is) you may be able to run that function directly. Also,
> a print() at the top abd bottom/return of the stalling function. And so
> on.
Dan
On 18Jan2023 16:10, Dan Kolis wrote:
I have written a very sizable and elaborate program that uses tKinter for X11
displays of genomics.
Yet maybe 1 of 6 times it freezes, so I decided to extract the minimum
that works perfectly and add back big pieces. It does it both running
.pyc and in VSC
I have written a very sizable and elaborate program that uses tKinter for X11
displays of genomics.
Yet maybe 1 of 6 times it freezes, so I decided to extract the minimum that
works perfectly and add back big pieces. It does it both running .pyc and in
VSCode.
so even the most minor of odditie
Thank you
--
https://mail.python.org/mailman/listinfo/python-list
On 1/18/23 14:42, Dan Kolis wrote:
>
>> I don't think you've described this. I don't know what you mean here.
>
> When I trace it in VSCode the imports seem like they endlessly suspend
> scanning and go to other ones over and over. Like "Whats this doi
On 19/01/23 10:40 am, Dan Kolis wrote:
I guess I don't full understand what bothers me about the repetition of the
imports so much.
It's doubtful that every module uses every one of those imports.
It looks like someone had a standard block of imports that they
blindly pasted at
> I don't think you've described this. I don't know what you mean here.
When I trace it in VSCode the imports seem like they endlessly suspend scanning
and go to other ones over and over. Like "Whats this doing ?"
--
https://mail.python.org/mailman/listinfo/python-list
extreme uniformity in the names and so on,
there utterly uniform, so there not so bad to consider, ( I hope ).
I guess I don't full understand what bothers me about the repetition of the
imports so much. The tracing of it seems so bizarre, it just seems like its
wrong.
Regs
Dan
--
ified. And anyway,
an imported module is only loaded a ready once; imports are kept track
of in the sys.modules dict, and just pulled directly from there when the
same module is requests by another import.
The hop around read keeps making me worry it migth leave some memory
leak or something
On Thu, 2023-01-19 at 09:47 +1300, dn via Python-list wrote:
> The longer an identifier, the more it 'pushes' code over to the right
> or
> to expand over multiple screen-lines. Some thoughts on this are
> behind
> PEP-008 philosophies, eg line-limit.
I sympathize with this issue. I've pushed t
18, 2023 at 3:49 PM
To: python-list@python.org
Subject: Re: Improvement to imports, what is a better way ?
*** Attention: This is an external email. Use caution responding, opening
attachments or clicking on links. ***
On 19/01/2023 08.56, Mats Wichmann wrote:
> On 1/18/23 12:29, Paul Bryan wr
dn and Mats, thanks for your advice.
I'm not sure what to do. Do either / both know if there is a way to make it
parse each import list to bytecode in one shot ?? The hop around read keeps
making me worry it migth leave some memory leak or something.
I dont know.
Thanks though, both your di
ces, which includes the question: which functions will
be called and thus which Python-modules should be imported? Thus,
listing all imports 'at the top' is a separable task.
- an early language learned (back-when) was COBOL, which has a formal
structure and separation between element
On 1/18/23 12:29, Paul Bryan wrote:
I would suggest allowing each module to define its own imports, don't
import what a module doesn't consume, keep them simple, avoid devising
a common namespace for each, and let tools like isort/black work out
how to order/express them in so
I would suggest allowing each module to define its own imports, don't
import what a module doesn't consume, keep them simple, avoid devising
a common namespace for each, and let tools like isort/black work out
how to order/express them in source files.
On Wed, 2023-01-18 at 10:43 -0800,
This program has lots of files and each is well segregated for a concept.
the top of each as a heap of imports, all identical. Well the very top has some
one of's
import os asos
import sys as sys
import importlib as importlib
i
On Thu, Sep 23, 2021 at 4:20 AM Dennis Lee Bieber wrote:
>
> The other alternative may be
> https://docs.python.org/3/library/functions.html#__import__
>
I wouldn't recommend calling a dunder. If you just want to pass a text
string and get back a module, importlib is a better choice.
Chr
On Tue, 21 Sep 2021 18:58:31 +, Travis Griggs
declaimed the following:
>from lib import paths
>import paths.dynamic_client_module()
>
>But this seems to not work. Import can only take real modules? Not programatic
>ones?
Consider "import" to be equivalent to a compile-time operatio
On Wed, Sep 22, 2021 at 6:05 AM <2qdxy4rzwzuui...@potatochowder.com> wrote:
>
> On 2021-09-22 at 05:10:02 +1000,
> Chris Angelico wrote:
>
> > You can dynamically import modules using importlib.import_module(),
> > but an easier way might just be a conditional import:
> >
> > # client/__init__.py
On 2021-09-22 at 05:10:02 +1000,
Chris Angelico wrote:
> You can dynamically import modules using importlib.import_module(),
> but an easier way might just be a conditional import:
>
> # client/__init__.py
> if some_condition:
> import module_a_default as module_a
> else:
> import module
t; model/
> model_a
> model_b
> ...
> top_level_a
> top_level_b
> ...
>
>
> I have a number of imports of module_a. I have a paths module that isolates
> all of my file system access, and that's where the determination can be made
> which one to
ed in a sort of once-and-only once spot?
For example, consider something like this:
client/
module_a
module_a_prime
lib/
paths
lib_a
lib_b
...
model/
model_a
model_b
...
top_level_a
top_level_b
...
I have a number of imports of module_a. I have a paths module that isolates
g.dnsalias.org/svn/cycles/trunk for now - no
> pypi, no homepage. I've only run it on some test inputs, nothing
> substantial. Usage example is in the Makefile.
>
> Imports are kind of complicated. Am I missing any important cases?
>
> Sample output looks like:
>
inputs, nothing substantial.
Usage example is in the Makefile.
Imports are kind of complicated. Am I missing any important cases?
Sample output looks like:
Detected 2 cycles:
('mutual_1', 'mutual_2')
('directory.mutual_a', 'directory.mutual_b', 'directory.mutual_c')
Thanks!
--
https://mail.python.org/mailman/listinfo/python-list
On Wed, Aug 18, 2021 at 4:10 AM Barry Scott wrote:
>
> def allImports( self, module_name ):
> for line in f:
> words = line.strip().split()
> if words[0:1] == ['import']:
> all_imports.append( words[1] )
>
This will work for a lo
On Monday, 16 August 2021 16:13:47 BST Dan Stromberg wrote:
> Hi folks.
>
> I'm working on a large codebase that has at least one cyclic import.
>
> In case I end up needing to eliminate the cyclic imports, is there any sort
> of tool that will generate an import graph and
Hi folks.
I'm working on a large codebase that has at least one cyclic import.
In case I end up needing to eliminate the cyclic imports, is there any sort
of tool that will generate an import graph and output Just the cycles?
I tried pyreverse, but it produced too big a graph to be very u
On 2021-02-26, MRAB wrote:
> On 2021-02-26 22:23, Kevin M. Wilson via Python-list wrote:
>
>> Is there a site where I might/can download a version of Tkinter for Python
>> 2.7?
>
> Tkinter as already included in Python 2.7.
Not always, it depends on how he installed Python 2.7. That said,
MRAB
On 26/02/2021 22:23, Kevin M. Wilson via Python-list wrote:
> Hey Community, Is there a site where I might/can download a version of
> Tkinter for Python 2.7?
Which OS?
If it's Linux you may need to fetch the tkinter
package for your distro.
In Windoze it should come as standard
In MacO
On 2021-02-26 22:23, Kevin M. Wilson via Python-list wrote:
Hey Community, Is there a site where I might/can download a version of
Tkinter for Python 2.7?
Tkinter as already included in Python 2.7.
--
https://mail.python.org/mailman/listinfo/python-list
Hey Community, Is there a site where I might/can download a version of
Tkinter for Python 2.7?
Seriously, KMW
John 1:4 "In him was life; and the life was the light of men."
--
https://mail.python.org/mailman/listinfo/python-list
ke 10. helmik. 2021 klo 5.07 Terry Reedy (tjre...@udel.edu) kirjoitti:
> On 2/9/2021 9:55 AM, Philipp Daher via Python-list wrote:
> > Hello,
> >
> > I’ve just typed „pip install selenium“ into my command prompt on windows
> 10. Although my computer told me that the requirement was already
> satis
On 2/9/2021 9:55 AM, Philipp Daher via Python-list wrote:
Hello,
I’ve just typed „pip install selenium“ into my command prompt on windows 10.
Although my computer told me that the requirement was already satisfied, import
selenium did not work. So I tried different methods to install it and ty
On 2/9/21 7:55 AM, Philipp Daher via Python-list wrote:
Hello,
I’ve just typed „pip install selenium“ into my command prompt on windows 10.
Although my computer told me that the requirement was already satisfied, import
selenium did not work. So I tried different methods to install it and type
Hello,
I’ve just typed „pip install selenium“ into my command prompt on windows 10.
Although my computer told me that the requirement was already satisfied, import
selenium did not work. So I tried different methods to install it and typed
„Python“ in my command prompt and imported selenium. It
"sufficiently obvious" are pretty
flexible. In particular, I'll list more items as the qualified names
get longer, as you noted. Source location is a non-issue; it's trivial
to jump to the imports at the top of the file, look it up and jump back
again. Or have two buffers v
On 2020-06-05 12:15, DL Neil via Python-list wrote:
> Finking/discussion:
>
> - how do you like to balance these three (and any other criteria)?
For most of what I do, I only ever have one such module so I'm not
trying keep multiple short-names in my head concurrently. For me,
it's usually tkint
How do you prefer to balance all of the above when import-ing?
Python offers a number of options for importing modules, eg
import module, ...
from importable import object, ...
most of which can be augmented with the "as preferred_name" syntax.
(ignoring the much-reviled "*" (import ev
I'm fussing over some details of relative imports while trying to mimic Python
module loading in my personal project. This is getting more into corner cases,
but I can spare time to talk about it while working on more normal stuff.
I first found this place:
https://manikos.github.io/how-py
Vladyslav Verteletskyi writes:
> I have stuck upon a problem with all of my attempts to import libraries to
> Python. Find the
> screenshots enclosed.
This is a text only list: we (at least most of us) do not see
attachments (such as attached screenshots). Use functions of
your (windows) sys
Dear developers,
I have stuck upon a problem with all of my attempts to import libraries to
Python. PyCharm and Anaconda both fail, as well as terminal. Find the
screenshots enclosed. I have tried reinstalling both several times, of no
help. All of the libraries I tried to import are already downl
s". To protect this object, Python must do something.
In former Python versions (somewhere before Python 3), it was using a
a thread lock: this could cause a deadlock in the case of some import
dependencies. The recoomendation to avoid the problem has been to
avoid module level imports for
On Thursday, 21 December 2017 00:33:54 UTC+1, Lawrence D’Oliveiro wrote:
> On Thursday, December 21, 2017 at 5:13:33 AM UTC+13, geoff...@gmail.com wrote:
> >
> > I have a multithreaded application using an embedded Python 3.6.4 ...
>
> Avoid multithreading if you can. Is your application CPU-bou
Hi all,
I have a multithreaded application using an embedded Python 3.6.4 (upgraded
from 3.6.2 today in the hope that the problem was now solved: it doesn't seem
to be). The standard library is in a zip file. So long as only one thread is
running Python at a time it seems to work fine. But ther
On Wed, May 25, 2016 at 6:27 PM, Steven D'Aprano
wrote:
> I don't think this is that much different from the way other scripting
> languages handle it. E.g. bash. If I have a set of (say) shell scripts:
>
> fnord/
> +-- foo.sh
> +-- bar.sh
>
>
> where foo.sh runs bar.sh, but fnord is *not* on the
d cannot be found by
the import system.
> To me, that makes Python at a severe handicap as a simple-to-use
> scripting language.
There's something to what you say, but I don't think it's quite that bad. To
me, "simple to use" means a stand-alone, single file .py
Gerald Britton writes:
> On Wed, 25 May 2016 10:00 am, Steven D'Aprano wrote:
> >The problem is that you are running the Python script from *inside*
> >the package. That means, as far as the script can see, there is no
> >longer a package visible -- it cannot see its own outside from the
> >insid
ur package layout is correct. But:
I have a similar setup, except with multiple files importing from
imported file. One way to make absolute imports within a package work,
and how I do it, is to put the directory containing testpkg in a .pth
file in the site-modules directory. In particula
xplanation, Steven. I'm just having trouble
reconciling this with the docs which seems to imply that an intra
package import should work from inside the package.
This bit:
"When packages are structured into subpackages (as with the sound
package in the example), you can use absolute imports t
On Wed, 25 May 2016 09:35 am, Gerald Britton wrote:
For brevity, here's your package setup:
testpkg/
+-- __init__.py
+-- testimport.py which runs "from testpkg.testimported import A"
+-- testimported.py containing class A
Your package layout is correct. But:
> When I run
>
> python testimport
I'm trying to understand packages in Python, especially Intra Package
References.
>From https://docs.python.org/2/tutorial/modules.html#packages i see that:
you can use absolute imports to refer to submodules of siblings packages.
This is what I can't get to work in my case. Her
On Mon, May 9, 2016, at 19:54, Brendan Abel wrote:
> Consider the following example python package where `a.py` and `b.py`
> depend on each other:
>
> /package
> __init__.py
> a.py
> b.py
>
>
> There are several ways I could import the "a.py" module in "b.py"
>
>
nc_b: %d" % x)
if x % 2: a.func_a(x-1)
rosuav@sikorsky:~/tmp$ python3
Python 3.6.0a0 (default:98678738b7e9, May 2 2016, 13:37:04)
[GCC 5.3.1 20160409] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import p
syntax actually work when you have
circular dependencies (the rest all raise `ImportError` or
`AttributeError`), and the 4th syntax only works in python 2 and is
generally discouraged because of the possibility of name conflicts.
I'd much rather use relative imports, or the "from x im
On Fri, Apr 8, 2016 at 11:50 AM, Rob Gaddi
wrote:
> Sort of. If I've got a directory full of files (in a package)
> that I'm working on, the relative import semantics change based on
> whether I'm one directory up and importing the package or in the same
> directory and importing the files locall
On Sat, Apr 9, 2016 at 3:50 AM, Rob Gaddi
wrote:
> Sort of. If I've got a directory full of files (in a package)
> that I'm working on, the relative import semantics change based on
> whether I'm one directory up and importing the package or in the same
> directory and importing the files locally
Chris Angelico wrote:
> On Sat, Apr 9, 2016 at 2:59 AM, Rob Gaddi
> wrote:
>> Rob Gaddi wrote:
>>
>>> Does anyone know the history of why relative imports are only available
>>> for packages and not for "programs"? It certainly complicates life.
>
On Sat, Apr 9, 2016 at 2:59 AM, Rob Gaddi
wrote:
> Rob Gaddi wrote:
>
>> Does anyone know the history of why relative imports are only available
>> for packages and not for "programs"? It certainly complicates life.
>>
>
> Really, no one? It seems like
Rob Gaddi wrote:
> Does anyone know the history of why relative imports are only available
> for packages and not for "programs"? It certainly complicates life.
>
Really, no one? It seems like a fairly obvious thing to have included;
all of the reasons that you want to be
Does anyone know the history of why relative imports are only available
for packages and not for "programs"? It certainly complicates life.
--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
On Mon, Feb 8, 2016 at 8:44 AM, wrote:
> I'm playing with some code that uses the wxpython grid. *Every*
> example I have seen starts with the imports:-
>
> import wx
> import wx.grid as Gridlib
>
> As Gridlib is exactly the same number of characters as wx.gri
I'm playing with some code that uses the wxpython grid. *Every*
example I have seen starts with the imports:-
import wx
import wx.grid as Gridlib
As Gridlib is exactly the same number of characters as wx.grid I
really don't see the point. Am I missing something?
--
C
test_database.py
test_client.py
My imports are simple. For example, client.py has the following at the top:
from collection import Collection
Basically, client has a Client class, collection has a Collection class, and
database has a Database class. Not too tough.
As long as I cd
.pth
file, as above.
Now minu is a *package*, and the modules "client.py", "collection.py" etc.
are assumed to collaborate rather than be a random collection of arbitrary
modules. From *outside* of minu, you can import submodules of the package:
import minu.collection
from
imports are simple. For example, client.py has the following at the top:
from collection import Collection
Basically, client has a Client class, collection has a Collection class, and
database has a Database class. Not too tough.
As long as I cd into the minu directory, I can fire up a python3
.py)
/project/test<-- test files
/project/docs <-- Sphinx
I cannot seem to be able to have py.test resolve imports by running
the following command from within the /project/project directory:
$ py.test ../
Example scripts:
/project/project/example.py
On Sunday, February 8, 2015 at 3:52:19 AM UTC+5:30, Gregory Ewing wrote:
> Rustom Mody wrote:
> > Wanted to try out sympy.
> > apt-install promised ź GB download, ž GB space usage
> >
> > Just getting a src-tarball was: 6M download, 30M after opening the tar.
>
> Have you actually tried compiling
Rustom Mody wrote:
Wanted to try out sympy.
apt-install promised ¼ GB download, ¾ GB space usage
Just getting a src-tarball was: 6M download, 30M after opening the tar.
Have you actually tried compiling and using that
tarball, though?
Sympy hooks into a lot of other libraries that
are themsel
On Saturday, February 7, 2015 at 8:43:44 AM UTC+5:30, Rustom Mody wrote:
> There is on the one hand python modules/packages mechanism with all the
> hell of dozens of incompatible versions of setuptools/distribute/distutils
> etc.
>
> On the other there is the OS-specific practices/policy such a
x27;s no need to explose those in a
> > > site package, they normally only need to be local to the
> > > application.
> >
> > If they are not in the Python module path, how are they imported at
> > all?
>
> Only absolute imports use the module search path. The
he
> > application.
>
> If they are not in the Python module path, how are they imported at
> all?
Only absolute imports use the module search path. The whole point of
relative imports is to import a module within the same (or a sub-)
package, without modifying the search path.
thon module path, how are they imported at all?
> Python deliberately divorces the top-level module from its package, so
> it can't access its own relative modules! The relative import fails with
> an ImportError “Attempted relative import in non-package”.
My understanding is that impo
ity that its implementation
occupies several sub-modules. There's no need to explose those in a site
package, they normally only need to be local to the application.
So the correct idiom is ‘from __future__ import absolute_import’ and
keep the application's own implementation
On Sun, Dec 7, 2014 at 9:50 AM, sam pendleton wrote:
> Having to put the garage package on the sys.path seems a little off,
> why wouldn't relative imports work?
Relative imports are relative to a package's hierarchy of namespaces, not
relative to the file system. As such, you
- Original Message -
> From: "sam pendleton"
> Having to put the garage package on the sys.path seems a little off,
> why wouldn't relative imports work?
>
> Do most people somehow put their packages in sys.path when bundling
> their python packages u
directory. Is garage/ on your sys.path?
You can examine sys.path by
import sys
print(sys.path)
Having to put the garage package on the sys.path seems a little off,
why wouldn't relative imports work?
Do most people somehow put their packages in sys.path when bundling
their p
saying that pytest is hung up there stating it can't
import that module.
> If you're going to import something, it either has to be on the sys.path, or
> in the current directory. Is garage/ on your sys.path?
>
> You can examine sys.path by
>import sys
>print(s
On 12/05/2014 11:50 PM, sam pendleton wrote:
garage/
|- __init__.py
|- cars/
|- __init__.py
|- hummer.py
tests/
|- test_cars.py
at the top of test_cars.py, there is this:
from garage.cars import hummer
pytest is on this import statement, so i guess it's inc
garage/
|- __init__.py
|- cars/
|- __init__.py
|- hummer.py
tests/
|- test_cars.py
at the top of test_cars.py, there is this:
from garage.cars import hummer
pytest is on this import statement, so i guess it's incorrect.
what should it be?
if i open a python repl
On 10/09/2014 04:14 PM, Ian Kelly wrote:
I have a use case where I would like to add a custom importer *AFTER* all other
import methods have failed.
On Oct 9, 2014 6:53 AM, "Gelonida N" mailto:gelon...@gmail.com>> wrote:
> I'm using Puthon 2.7 for the given project and there sys.meta_path is
On Oct 9, 2014 6:53 AM, "Gelonida N" wrote:
> I'm using Puthon 2.7 for the given project and there sys.meta_path is [].
>
> Just for fun I started Python3.3 and looked at it's meta_path, which
contained for example _frozen_importlib.PathFinder
>
> Unfortunately python 2.7 does not seem to have the
On 10/9/2014 12:44 AM, Ian Kelly wrote:
On Wed, Oct 8, 2014 at 4:53 AM, Gelonida N wrote:
Hi,
I just read about sys.meta_path, which allows to install custom importers
*BEFORE* the default importers.
However I have a use case where I would like to add a custom importer
*AFTER* all other impo
On Wed, Oct 8, 2014 at 4:53 AM, Gelonida N wrote:
> Hi,
>
>
> I just read about sys.meta_path, which allows to install custom importers
> *BEFORE* the default importers.
>
> However I have a use case where I would like to add a custom importer
> *AFTER* all other import methods have failed.
>
> Do
Hi,
I just read about sys.meta_path, which allows to install custom
importers *BEFORE* the default importers.
However I have a use case where I would like to add a custom importer
*AFTER* all other import methods have failed.
Does anybody know how to do this.
One way of implementing this
Roy Smith wrote:
> http://docs.python.org/2/whatsnew/2.5.html says:
>
> "Once absolute imports are the default, import string will always find
> the standard library¹s version."
>
> Experimentally, it appears that modules in site-packages are also found
> b
On Sun, Feb 16, 2014 at 2:06 AM, Roy Smith wrote:
> It also says, "This absolute-import behaviour will become the default in
> a future version (probably Python 2.7)", but it appears that 2.7.6 is
> still doing relative by default.
>
Since absolute imports can be co
http://docs.python.org/2/whatsnew/2.5.html says:
"Once absolute imports are the default, import string will always find
the standard library¹s version."
Experimentally, it appears that modules in site-packages are also found
by absolute imports. I wouldn't consider site-package
1 - 100 of 644 matches
Mail list logo