[issue36375] PEP 499 implementation: "python -m foo" binds the main module as both __main__ and foo in sys.modules

2019-12-15 Thread Nick Coghlan
Nick Coghlan added the comment: Leaving the relationship between pickle and __name__ alone wasn't an oversight, as folks already rely on that to gracefully transition from single-file modules to multi-file packages without breaking pickle compatibility in either direction. The trick is to

[issue36375] PEP 499 implementation: "python -m foo" binds the main module as both __main__ and foo in sys.modules

2019-11-26 Thread Eric Snow
Eric Snow added the comment: Exactly. :) I'd expect PEP 499 to specify changing __module__ of classes and functions from __main__ to the module name (__spec__.name). This aligns closely with the whole point of the PEP. :) As a bonus, it will simplify things for pickling (which doesn't

[issue36375] PEP 499 implementation: "python -m foo" binds the main module as both __main__ and foo in sys.modules

2019-11-25 Thread Cameron Simpson
Cameron Simpson added the comment: On 25Nov2019 17:38, Python Bug Reports wrote: >Eric Snow added the comment: > >FWIW, I have some feedback on the PEP. (See msg357448.) Can we discuss here >or should I open a mailing list thread? Let's discuss it here unless it looks like we need wider

[issue36375] PEP 499 implementation: "python -m foo" binds the main module as both __main__ and foo in sys.modules

2019-11-25 Thread Eric Snow
Eric Snow added the comment: FWIW, I have some feedback on the PEP. (See msg357448.) Can we discuss here or should I open a mailing list thread? -- nosy: +eric.snow ___ Python tracker

[issue36375] PEP 499 implementation: "python -m foo" binds the main module as both __main__ and foo in sys.modules

2019-11-12 Thread Cameron Simpson
Cameron Simpson added the comment: Just a remark about the preamble comment: it reads to me as though PEP499 is a misfeature. Possibly change: We actually want the double import, so remove the alias if it exists. to: This module is unusual, and actually wants the double import.

[issue36375] PEP 499 implementation: "python -m foo" binds the main module as both __main__ and foo in sys.modules

2019-11-12 Thread Cameron Simpson
Cameron Simpson added the comment: I want to start with an apology. I have become a little swamped by work and didn't let anyone know I've made little time for this since March. To my naive eye Nick's snippet looks like it would work for pdb; I became a little stalled there trying to

[issue36375] PEP 499 implementation: "python -m foo" binds the main module as both __main__ and foo in sys.modules

2019-11-12 Thread Nick Coghlan
Nick Coghlan added the comment: [Belatedly updating this issue with the current status as of March] Cameron's implementation generally looks good, but there are couple of compatibility/migration questions that we need to consider, as spelled out in the PEP update that added me as

[issue36375] PEP 499 implementation: "python -m foo" binds the main module as both __main__ and foo in sys.modules

2019-08-21 Thread Greg Price
Change by Greg Price : -- nosy: +Greg Price ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36375] PEP 499 implementation: "python -m foo" binds the main module as both __main__ and foo in sys.modules

2019-03-21 Thread Cameron Simpson
Cameron Simpson added the comment: New PR 12490 attached with a fix for test_pdb. More extensive comments are in the leading comment on the PR itself. - Cameron -- ___ Python tracker

[issue36375] PEP 499 implementation: "python -m foo" binds the main module as both __main__ and foo in sys.modules

2019-03-21 Thread Cameron Simpson
Change by Cameron Simpson : -- pull_requests: +12442 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36375] PEP 499 implementation: "python -m foo" binds the main module as both __main__ and foo in sys.modules

2019-03-20 Thread Cameron Simpson
Cameron Simpson added the comment: I've withdrawn the PR; I hadn't run the full test suite and there are things to fix. - Cameron -- ___ Python tracker ___

[issue36375] PEP 499 implementation: "python -m foo" binds the main module as both __main__ and foo in sys.modules

2019-03-19 Thread Cameron Simpson
Change by Cameron Simpson : -- keywords: +patch pull_requests: +12408 stage: -> patch review ___ Python tracker ___ ___

[issue36375] PEP 499 implementation: "python -m foo" binds the main module as both __main__ and foo in sys.modules

2019-03-19 Thread Cameron Simpson
New submission from Cameron Simpson : This issue is to track the implementation of PEP 499 which we hope to get into the upcoming 3.8 release. I've made it because cpython PRs want a bpo number in the subject line. I'll link in the proposed PR once I've filed off a few grammar issues I've