Re: [Python-Dev] .Idle.py init file

2009-02-15 Thread Daniel (ajax) Diniz
Mitchell,

I can't find the string ".Idle.py" in trunk. If you haven't already,
please open a documentation issue for this one. I don't see any
obvious downside to this behavior and people might be relying on it by
now.

Thanks for  reporting these IDLE issues!

Daniel
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] .Idle.py init file

2009-02-12 Thread Mitchell L Model
I was trying to disentangle some IDLE behavior today and discovered 
that If the user has a .Idle.py file IDLE will run it when it starts 
up. This is independent of running IDLESTARTUP or PYTHONSTARTUP when 
the -s switch is given. It is run by Tk.readprofile as called from 
Tk.__init__. The "Idle" comes from the name passed to TK() when 
PyShell.py creates its Tk root. In fact, not only is it independent, 
but it works differently: any imports done in .Idle.py go into Tk's 
name space, whereas IDLESTARTUP/PYTHONSTARTUP is exec'd and imports 
go into the interpreter's namespace.


I don't think this behavior is documented anywhere, although since I 
had a .Idle.py file I must have seen something about this somewhere 
at some point. It's very hard to search for ".Idle.py" when "idle.py" 
is a file whose name appears frequently in discussions.


Is this something that I should submit as an Issue or is it widely 
known behavior? It should at least be documented.

___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com