emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Loading a package applies automatically to future sessions?


From: Clément Pit-Claudel
Subject: Re: Loading a package applies automatically to future sessions?
Date: Sun, 4 Feb 2018 23:15:00 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

On 2018-02-04 20:08, Richard Stallman wrote:
>   > > Does Python have autoloads?  I would expect not.
> 
>   > Yes, in two senses:
> 
>   > * Installing a package with 'pip' commonly installs small binaries in 
> your path, so you can call the program from the command line.
>   > * Python has .pth files that work essentially like Emacs autoloads.  
> These aren't used very commonly.
> 
> How do these autoload-like constructs in Python interact with
> the usual need to 'import' a package to make its entry points accessible?

They're the first thing the interpreter runs when it starts.  You can write 
'import foo' on a separate line, and then python imports 'foo' before running 
your actual program.  The code in 'foo' can then introduce new global names by 
modifying the builtins dictionary (this isn't a very common practice)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]