Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #77138
| Newsgroups | comp.lang.python |
|---|---|
| Date | 2014-08-27 08:25 -0700 |
| References | (1 earlier) <mailman.13475.1409078833.18130.python-list@python.org> <5a9b5715-382b-4a6b-be90-c535ad14740a@googlegroups.com> <b92274f5-6ed8-451a-b01a-0874a1048b54@googlegroups.com> <c64eh8F4jkuU1@mid.individual.net> <696490b0-065f-4a6a-b6fd-3e760d168140@googlegroups.com> |
| Message-ID | <9c3a125a-7137-495f-b26c-4098360ba21d@googlegroups.com> (permalink) |
| Subject | Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? |
| From | Twirlip2 <ahrodg@googlemail.com> |
On Tuesday, 26 August 2014 23:55:51 UTC+1, Twirlip2 wrote:
> It doesn't seem immediately obvious how to get a definitive list
> of which names to avoid using (and therefore, inadvertently
> 'shadowing', as I did today).
>
> For example,
> <https://docs.python.org/3/tutorial/modules.html#standard-modules>
> doesn't list the filename 'code.py', which is the one I clashed
> with today.
>
> Of course, if all else fails, I will be sure to manually search
> the Python installation directory for possible clashes, but there
> must be a more logically secure way, one more integral to the
> language itself.
Does the interaction below (copied from an IDLE session) show a safe
and reliable way to do it?
>>> from importlib.util import find_spec
>>> find_spec('code')
ModuleSpec(name='code', loader=<_frozen_importlib.SourceFileLoader object at 0x01139330>, origin='I:\\Python34\\lib\\code.py')
>>> find_spec('ftang')
>>>
This seems to show that I can safely use the name 'ftang.py'
for a module in the search path, if I want; but might it be
dangerous in some way, or might it fail to find some module
name that I might still cause a clash with?
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Twirlip2 <ahrodg@googlemail.com> - 2014-08-26 11:01 -0700
Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Terry Reedy <tjreedy@udel.edu> - 2014-08-26 14:46 -0400
Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Twirlip2 <ahrodg@googlemail.com> - 2014-08-26 12:20 -0700
Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Twirlip2 <ahrodg@googlemail.com> - 2014-08-26 12:44 -0700
Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Twirlip2 <ahrodg@googlemail.com> - 2014-08-26 12:58 -0700
Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-08-26 21:15 +0100
Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-08-27 10:03 +1200
Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Twirlip2 <ahrodg@googlemail.com> - 2014-08-26 15:55 -0700
Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Twirlip2 <ahrodg@googlemail.com> - 2014-08-27 08:25 -0700
Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-08-27 10:01 +1000
Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Twirlip2 <ahrodg@googlemail.com> - 2014-08-26 17:06 -0700
Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Chris Angelico <rosuav@gmail.com> - 2014-08-27 10:18 +1000
Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-08-27 00:20 +0100
Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Twirlip2 <ahrodg@googlemail.com> - 2014-08-26 16:29 -0700
Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Terry Reedy <tjreedy@udel.edu> - 2014-08-26 20:51 -0400
Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Twirlip2 <ahrodg@googlemail.com> - 2014-08-26 18:11 -0700
Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Terry Reedy <tjreedy@udel.edu> - 2014-08-27 00:03 -0400
Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Twirlip2 <ahrodg@googlemail.com> - 2014-08-27 02:12 -0700
Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Twirlip2 <ahrodg@googlemail.com> - 2014-08-26 12:26 -0700
Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Zachary Ware <zachary.ware+pylist@gmail.com> - 2014-08-26 14:46 -0500
Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Grant Edwards <invalid@invalid.invalid> - 2014-08-26 18:59 +0000
Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Chris Angelico <rosuav@gmail.com> - 2014-08-27 09:07 +1000
Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Twirlip2 <ahrodg@googlemail.com> - 2014-08-26 16:25 -0700
Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what? Chris Angelico <rosuav@gmail.com> - 2014-08-27 09:42 +1000
Python conquors the BBC [was Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what?] Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-08-27 10:04 +1000
Re: Python conquors the BBC [was Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what?] Twirlip2 <ahrodg@googlemail.com> - 2014-08-26 17:08 -0700
Re: Python conquors the BBC [was Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what?] Chris Angelico <rosuav@gmail.com> - 2014-08-27 10:21 +1000
Re: Python conquors the BBC [was Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what?] Twirlip2 <ahrodg@googlemail.com> - 2014-08-26 17:58 -0700
Re: Python conquors the BBC [was Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what?] Twirlip2 <ahrodg@googlemail.com> - 2014-08-26 18:06 -0700
Re: Python conquors the BBC [was Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what?] Chris Angelico <rosuav@gmail.com> - 2014-08-27 12:36 +1000
Re: Python conquors the BBC [was Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what?] Rustom Mody <rustompmody@gmail.com> - 2014-08-26 20:13 -0700
Re: Python conquors the BBC [was Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what?] Chris Angelico <rosuav@gmail.com> - 2014-08-27 14:55 +1000
Re: Python conquors the BBC [was Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what?] Twirlip2 <ahrodg@googlemail.com> - 2014-08-27 01:50 -0700
Re: Python conquors the BBC [was Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what?] Chris “Kwpolska” Warrick <kwpolska@gmail.com> - 2014-08-27 10:12 +0200
Re: Python conquors the BBC [was Re: IDLE has suddenly become FAWLTY - so should I be hitting it with a big stick, or what?] Twirlip2 <ahrodg@googlemail.com> - 2014-08-27 02:04 -0700
csiph-web