[issue30024] Treat `import a.b.c as m` as `m = sys.modules['a.b.c']`

2017-04-22 Thread Victor Varvariuc
Victor Varvariuc added the comment: How can I facilitate/contribute to get the changes suggested by Serhiy into Python? -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue30024] Treat `import a.b.c as m` as `m = sys.modules['a.b.c']`

2017-04-09 Thread Victor Varvariuc
Victor Varvariuc added the comment: > it is possible for module a to override its attribute b without updating > sys.modules This sounds like a really strange application. Even if someone overrides the attribute, when you do in other place `import a.b.c as m` you expect `a.b.c` to b

[issue30024] Treat `import a.b.c as m` as `m = sys.modules['a.b.c']`

2017-04-09 Thread Victor Varvariuc
Victor Varvariuc added the comment: > I'm inclined not to attempt to fix this. The reason that we don't pull 'a.b' > out of sys.modules at this point is that if later in the execution of a/b.py > we get an exception, the import will be cancelled, and sys.modules['a.b'] > will

[issue30024] Treat `import a.b.c as m` as `m = sys.modules['a.b.c']`

2017-04-09 Thread Victor Varvariuc
Victor Varvariuc added the comment: # mytest/mod2.py: import sys import mytest.mod1 assert 'mytest.mod1' in sys.modules import mytest.mod1 as mod # this fails, though the prev. lines work perfectly -- Added file: http://bugs.python.org/file46794/test.zip

[issue30024] Treat `import a.b.c as m` as `m = sys.modules['a.b.c']`

2017-04-09 Thread Victor Varvariuc
New submission from Victor Varvariuc: https://mail.python.org/pipermail/python-ideas/2017-April/045405.html Hi there. I asked a question <http://stackoverflow.com/questions/41845671/import-as-in-python-3> on Stackoverflow: > (Pdb) import brain.utils.mail > (Pdb) import brai

[issue14119] Ability to adjust queue size in Executors

2014-01-10 Thread Victor Varvariuc
Victor Varvariuc added the comment: Hi! Looks like your pseudocode will work as a workaround instead of monkey-patching! Still the my suggestion to add the line to code stays. self._count should be always equal to the length of self._work_queue? If yes, why duplication. If no - which one

[issue14119] Ability to adjust queue size in Executors

2014-01-07 Thread Victor Varvariuc
Victor Varvariuc added the comment: Maybe I should have created another issue for this, but without this issue being solved, the new issue will not help much. Here it is: http://hg.python.org/cpython/file/37caaf21f827/Lib/concurrent/futures/thread.py#l63 After running an work item

[issue14119] Ability to adjust queue size in Executors

2014-01-07 Thread Victor Varvariuc
Victor Varvariuc added the comment: Hi Brian, In one my projects I had to monkey-patch module `concurrent.futures.thread:60`( http://hg.python.org/cpython/file/37caaf21f827/Lib/concurrent/futures/thread.py#l60) with: def _worker(executor_reference, work_queue): try: while True