[Python-3000] PEP to change how the main module is delineated (original) (raw)
Brett Cannon brett at python.org
Mon Apr 23 05:56:54 CEST 2007
- Previous message: [Python-3000] PEP to change how the main module is delineated
- Next message: [Python-3000] PEP to change how the main module is delineated
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 4/22/07, Neal Norwitz <nnorwitz at gmail.com> wrote:
Can you add refs to all the PEPs?
Sure, although considering my laptop died within minutes of my last commit to 25-maint it might be a little while (using my girlfriend's laptop to check email).
Will this go into 2.6 also?
It's covered in the transition plan. Basically sys.main just becomes equal to "main" and nothing else changes. Figured didn't have to involve python-dev with such a minor change. Plus Guido has to go for this first. =)
If so, you should send to python-dev too. If this is accepted, can you update the 2.6 PEP 361.
If I remember, sure. =)
On 4/22/07, Brett Cannon <brett at python.org> wrote: > > Implementation > ============== > > When the
-moption is used,sys.mainwill be set to the > argument passed in.sys.argvwill be adjusted as it is currently. > Then the equivalent of_import_(self.main)will occur. This > differs from current semantics as therunpymodule fetches the > code object for the file specified by the module name in order to > explicitly set_name_and other attributes. This is no longer > needed as import can perform its normal operation in this situation. > > If a file name is specified, thensys.mainwill be set to >"_main_". The specified file will then be read and have a code > object created and then be executed with_name_set to >"_main_". This mirrors current semantics.What happens when no file is passed in (ie, interactive) or when -c is used? Will sys.main be set? If so, to what?
Good question. I would think None would be a good value. Otherwise the empty string if people don't want to have a possibly different type other than str in the attribute.
-Brett
- Previous message: [Python-3000] PEP to change how the main module is delineated
- Next message: [Python-3000] PEP to change how the main module is delineated
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]