[issue28202] Python 3.5.1 C API, the global variable is not destroyed when delete the module

2016-09-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Please output Py_REFCNT(py_module) and Py_REFCNT(py_dict) before deleting the module from sys.modules. Is there a difference between 3.5 and 3.6? -- nosy: +serhiy.storchaka ___ Python tracker

[issue26351] Occasionally check for Ctrl-C in long-running operations like sum

2016-09-20 Thread Nick Coghlan
Nick Coghlan added the comment: While I agree with Raymond regarding the performance implications if this isn't handled carefully, I think we're also getting to a point where better accounting for signal handling latency in inner loops is something that could be considered for 3.7 - the

[issue28162] WindowsConsoleIO readall() fails if first line starts with Ctrl+Z

2016-09-20 Thread Eryk Sun
Eryk Sun added the comment: For breaking out of the readall while loop, you only need to check if the current read is empty: /* when the read is empty we break */ if (n == 0) break; Also, the logic is wrong here: if (len == 0 || buf[0] == '\x1a' &&

Re: Data Types

2016-09-20 Thread Steven D'Aprano
On Wednesday 21 September 2016 14:03, Cai Gengyang wrote: > So for example for "bool" , it only applies to True/False and nothing else? Correct. True and False are the only instances of the type 'bool'. > (2 data types), i.e. : > type(True) > type(False) > > > Are there any other

Re: Python 3.5.1 C API, the global available available is not destroyed when delete the module

2016-09-20 Thread dieter
dl l writes: > I found the problem is resolved if call PyGC_Collect() after > PyDict_DelItemString(). Is it expected to call PyGC_Collect() here for > Python 3.5 which is not needed for Python 3.3? Usually, Python uses reference counting to determine when an object can be

[issue28202] Python 3.5.1 C API, the global variable is not destroyed when delete the module

2016-09-20 Thread Jack Liu
Jack Liu added the comment: Looks to me, there is NO reference cycle on the Simple object in the python test code. Why needs to call PyGC_Collect() here? -- ___ Python tracker

[issue13276] bdist_wininst-created installer does not run the postinstallation script when uninstalling

2016-09-20 Thread Petri Savolainen
Changes by Petri Savolainen : -- nosy: +petri ___ Python tracker ___ ___ Python-bugs-list

[issue28222] test_distutils fails

2016-09-20 Thread Xiang Zhang
New submission from Xiang Zhang: test_distutils consistently fails now: ./python -m test test_distutils Run tests sequentially 0:00:00 [1/1] test_distutils test test_distutils failed -- Traceback (most recent call last): File "/home/angwer/cpython/Lib/distutils/tests/test_check.py", line 122,

[issue28202] Python 3.5.1 C API, the global variable is not destroyed when delete the module

2016-09-20 Thread Josh Rosenberg
Josh Rosenberg added the comment: The fact that it's resolved by PyGC_Collect indicates there is a reference cycle somewhere. PyGC_Collect is just looking for cyclic garbage and breaking the cycles so it can be cleaned; it would happen eventually unless GC was explicitly disabled or the

[issue28201] dict: perturb shift should be done when first conflict

2016-09-20 Thread Josh Rosenberg
Josh Rosenberg added the comment: Removing those unrelated changes looks like it would dramatically reduce the churn too, making review easier. -- ___ Python tracker

[issue28201] dict: perturb shift should be done when first conflict

2016-09-20 Thread Josh Rosenberg
Josh Rosenberg added the comment: General comment on the patch: I believe per PEP7, we're still sticking to ANSI C (aka C89), and specifically, "all declarations must be at the top of a block (not necessarily at the top of function". The patch assumes lax standards compliance (or C99+

Re: Linear Time Tree Traversal Generator

2016-09-20 Thread Random832
On Tue, Sep 20, 2016, at 23:34, Steve D'Aprano wrote: > One of us is badly missing something. The problem is the number of times next is called. Here, it'll be more clear if we wrap the iterator in the original example to print each time next is called. class WrappedIterator(): def

[issue28221] Unused indata in test_ssl.ThreadedTests.test_asyncore_server

2016-09-20 Thread Martin Panter
Martin Panter added the comment: Actually in the Py 3 branch, I found an earlier revision that added indata="FOO\n": r59506 (Dec 2007). Anyway, the server in the test case just does a simple lower() call on the data, so I think the simpler FOO line may be fine on its own. -- stage:

Re: Data Types

2016-09-20 Thread Cai Gengyang
On Wednesday, September 21, 2016 at 11:22:42 AM UTC+8, Steve D'Aprano wrote: > On Wed, 21 Sep 2016 01:00 pm, Cai Gengyang wrote: > > > So I am going through chapter 7.1 (Data Types) of > > http://programarcadegames.com/index.php… What do these terms (input and > > output) mean --- Can someone

Re: Python 3.5.1 C API, the global available available is not destroyed when delete the module

2016-09-20 Thread dl l
Thank you all for the help. I found the problem is resolved if call PyGC_Collect() after PyDict_DelItemString(). Is it expected to call PyGC_Collect() here for Python 3.5 which is not needed for Python 3.3? 2016-09-20 16:01 GMT+08:00 Chris Angelico : > On Tue, Sep 20, 2016 at

[issue28202] Python 3.5.1 C API, the global variable is not destroyed when delete the module

2016-09-20 Thread Jack Liu
Jack Liu added the comment: The problem is resolved if call PyGC_Collect() after PyDict_DelItemString(). Is it expected to call PyGC_Collect() here? -- ___ Python tracker

Re: Linear Time Tree Traversal Generator

2016-09-20 Thread Steve D'Aprano
On Wed, 21 Sep 2016 12:47 pm, Chris Angelico wrote: > On Wed, Sep 21, 2016 at 12:34 PM, Steve D'Aprano > wrote: >> "since values from the leaves of the tree have to be yielded >> multiple times to the top of the tree" >> >> Each leaf is yielded once, and I

Re: Linear Time Tree Traversal Generator

2016-09-20 Thread Steve D'Aprano
On Wed, 21 Sep 2016 02:46 am, ROGER GRAYDON CHRISTMAN wrote: > I am trying to find a better (i.e. more efficient) way to implement a > generator that traverses a tree. > > The current model of the code (which is also used by a textbook I am > teaching from does this) > >def __iter__(node):

Re: Data Types

2016-09-20 Thread Steve D'Aprano
On Wed, 21 Sep 2016 01:00 pm, Cai Gengyang wrote: > So I am going through chapter 7.1 (Data Types) of > http://programarcadegames.com/index.php… What do these terms (input and > output) mean --- Can someone explain in plain English and layman's terms ? http://www.dictionary.com/browse/input

Re: Linear Time Tree Traversal Generator

2016-09-20 Thread Steve D'Aprano
On Wed, 21 Sep 2016 12:44 pm, Random832 wrote: > On Tue, Sep 20, 2016, at 22:34, Steve D'Aprano wrote: >> I'm afraid I don't understand this. This is a standard binary tree >> inorder traversal. Each node is visited once, and there are N nodes, >> so I make that out to be O(N) not O(N log N). I'm

Data Types

2016-09-20 Thread Cai Gengyang
So I am going through chapter 7.1 (Data Types) of http://programarcadegames.com/index.php… What do these terms (input and output) mean --- Can someone explain in plain English and layman's terms ? Thanks a lot ... >>> type(3) >>> type(3.145) >>> type("Hi there") >>> type(True) --

Re: Linear Time Tree Traversal Generator

2016-09-20 Thread Chris Angelico
On Wed, Sep 21, 2016 at 12:34 PM, Steve D'Aprano wrote: > "since values from the leaves of the tree have to be yielded > multiple times to the top of the tree" > > Each leaf is yielded once, and I don't understand what you mean by yielding > to the top of the

Re: Linear Time Tree Traversal Generator

2016-09-20 Thread Random832
On Tue, Sep 20, 2016, at 22:34, Steve D'Aprano wrote: > I'm afraid I don't understand this. This is a standard binary tree > inorder traversal. Each node is visited once, and there are N nodes, > so I make that out to be O(N) not O(N log N). I'm afraid I can't parse > your final clause: > >

Re: Linear Time Tree Traversal Generator

2016-09-20 Thread Steve D'Aprano
On Wed, 21 Sep 2016 02:46 am, ROGER GRAYDON CHRISTMAN wrote: > I am trying to find a better (i.e. more efficient) way to implement a > generator that traverses a tree. > > The current model of the code (which is also used by a textbook I am > teaching from does this) > >def __iter__(node):

Re: automated comparison tool

2016-09-20 Thread Lawrence D’Oliveiro
On Wednesday, September 21, 2016 at 12:14:54 PM UTC+12, Bill Deegan wrote: > Use Git... at least you get can back what used to work.. That has become such a matter of programming habit, taken so much for granted that, to me, it’s like saying “don’t forget to breathe”. :) --

[issue28221] Unused indata in test_ssl.ThreadedTests.test_asyncore_server

2016-09-20 Thread Martin Panter
New submission from Martin Panter: In r62273 (Apr 2008), method testAsyncoreServer() was added to the py3k branch with indata="FOO\n". In r64578 (Jun 2008), this test method was added to the Py 2 branch, but with indata = "TEST MESSAGE of mixed case\n". Later, r80598 added the mixed case line

Re: Idiomatic code validator?

2016-09-20 Thread Tim Johnson
* Steve D'Aprano [160920 16:29]: > On Wed, 21 Sep 2016 01:41 am, Tim Johnson wrote: > > > Not to confuse idiomatic code validation with pep8 validation (I use > > elpy on emacs) > > > > Is there such a thing as a validator for _idiomatic_ code? > > > Yes, it is

Re: Idiomatic code validator?

2016-09-20 Thread Tim Johnson
* Steve D'Aprano [160920 16:29]: > On Wed, 21 Sep 2016 01:41 am, Tim Johnson wrote: > > > Not to confuse idiomatic code validation with pep8 validation (I use > > elpy on emacs) > > > > Is there such a thing as a validator for _idiomatic_ code? > > > Yes, it is

[issue22431] Change format of test runner output

2016-09-20 Thread Robert Collins
Robert Collins added the comment: +1 to changing the UI for 3.7 - just noting that if you're machine processing the output, the TUI isn't an appropriate channel. -- ___ Python tracker

Re: Linear Time Tree Traversal Generator

2016-09-20 Thread ROGER GRAYDON CHRISTMAN
On Tue, Sep 20, 2016 at 9:46 AM, ROGER GRAYDON CHRISTMAN d...@psu.edu> wrote: >I am trying to find a

Re: automated comparison tool

2016-09-20 Thread Steve D'Aprano
On Wed, 21 Sep 2016 07:20 am, Andrew Clark wrote: > I've restarted my code so many times i no longer have a working version of > anything. *Restarting* your code doesn't change it and cannot possibly stop it from working. My guess is that you actually mean that you've made so many random edits

[issue22431] Change format of test runner output

2016-09-20 Thread R. David Murray
R. David Murray added the comment: My understanding of the comments is that the change to the default is OK (in a feature release, at least). -- versions: +Python 3.7 -Python 3.5 ___ Python tracker

Re: list or dictionary

2016-09-20 Thread Steve D'Aprano
On Wed, 21 Sep 2016 04:04 am, Ganesh Pal wrote: > I am on python 2.7 and Linux > > I have the stdout in the below form , I need to write a function to get > hostname for the given id. > > > Example: > stdout > 'hostname-1 is array with id 1\nhostname-2 is array with id 2\nhostname-3 >

[issue22431] Change format of test runner output

2016-09-20 Thread Tim Graham
Tim Graham added the comment: Here's the patch if we make the change in Django instead: https://github.com/cjerdonek/django/commit/9c8d162f3f616e9d9768659a06fcf27bb389214b -- ___ Python tracker

Re: Idiomatic code validator?

2016-09-20 Thread Steve D'Aprano
On Wed, 21 Sep 2016 01:41 am, Tim Johnson wrote: > Not to confuse idiomatic code validation with pep8 validation (I use > elpy on emacs) > > Is there such a thing as a validator for _idiomatic_ code? Yes, it is called a linter. There are various linters available: pylint, pychecker, jedi,

[issue22431] Change format of test runner output

2016-09-20 Thread Tim Graham
Tim Graham added the comment: Is there opposition to changing the default output as outlined in the first comment? If so, then I think this ticket should be closed or retitled to reflect the intent. -- nosy: +Tim.Graham ___ Python tracker

Re: automated comparison tool

2016-09-20 Thread Bill Deegan
Use Git... at least you get can back what used to work.. On Tue, Sep 20, 2016 at 2:20 PM, Andrew Clark wrote: > On Tuesday, September 20, 2016 at 3:25:11 PM UTC-5, Lawrence D’Oliveiro > wrote: > > On Wednesday, September 21, 2016 at 7:44:22 AM UTC+12, Andrew Clark > wrote: >

Re: how to automate java application in window using python

2016-09-20 Thread Matt Wheeler
On Tue, 20 Sep 2016, 02:47 meInvent bbird, wrote: > can it contorl Maplesoft's maple which is a java executable file? > I don't know maple so I can't answer that. Which programming language an application is written in isn't really relevant for pywinauto, it's the

[issue17218] support title and description in argparse add_mutually_exclusive_group

2016-09-20 Thread Barry A. Warsaw
Changes by Barry A. Warsaw : -- nosy: +barry ___ Python tracker ___ ___ Python-bugs-list

Re: get the sum of differences between integers in a list

2016-09-20 Thread John Pote
On 20/09/2016 12:52, Daiyue Weng wrote: Hi, I have a list numbers say, [1,2,3,4,6,8,9,10,11] First, I want to calculate the sum of the differences between the numbers in the list. At least for this first part a little pencil, paper and algebra yields a simple formula of constant and minimal

Re: How to install Python.h on FreeBSD 10.3-RELEASE?

2016-09-20 Thread The Doctor
In article <201609...@crcomp.net>, Don Kuenz wrote: > >The Doctor wrote: >> In article <201609...@crcomp.net>, Don Kuenz wrote: >>> >>>It turns out that the question isn't "How to install Python.h?" The >>>question is "Why doesn't

Re: pypy on windows much slower than linux/mac when using complex number type?

2016-09-20 Thread Chris Kaynor
On Tue, Sep 20, 2016 at 3:59 PM, Chris Angelico wrote: > On Wed, Sep 21, 2016 at 8:50 AM, Irmen de Jong > wrote: > >> Dunno if it's the cause or not, but you're running a 32-bit PyPy on a > >> 64-bit Windows. I could well imagine that that has some odd

[issue28213] asyncio SSLProtocol _app_transport is private

2016-09-20 Thread Andrew Svetlov
Andrew Svetlov added the comment: -1, agree with Yury. As an option it's possible to wrap `sslproto.SSLProtocol` by custom derived class which overrides `connection_made()` for storing a transport somewhere. The solution looks like sub-optimal but it's backward-compatible. The other problem is:

Re: pypy on windows much slower than linux/mac when using complex number type?

2016-09-20 Thread Chris Angelico
On Wed, Sep 21, 2016 at 8:50 AM, Irmen de Jong wrote: >> Dunno if it's the cause or not, but you're running a 32-bit PyPy on a >> 64-bit Windows. I could well imagine that that has some odd >> significance. >> >> ChrisA > > > Perhaps. Though I can't really imagine what's

[issue28220] argparse's add_mutually_exclusive_group() should accept title and description

2016-09-20 Thread Berker Peksag
Berker Peksag added the comment: Unless I'm missing something, this is a duplicate of issue 17218 :) -- nosy: +berker.peksag resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> support title and description in argparse add_mutually_exclusive_group

Re: pypy on windows much slower than linux/mac when using complex number type?

2016-09-20 Thread Irmen de Jong
On 20-9-2016 22:43, Chris Angelico wrote: > On Wed, Sep 21, 2016 at 6:38 AM, Irmen de Jong wrote: >> Windows: 64 bits Windows 7, Intel Core 2 Quad 3.4 Ghz >> Linux: 32 bits Mint 18, Virtualbox VM on above windows machine >> Mac mini: OS X 10.11.6, Intel Core 2 Duo 2.53

[issue28217] Add interactive console tests

2016-09-20 Thread Eryk Sun
Changes by Eryk Sun : Added file: http://bugs.python.org/file44765/conout.py ___ Python tracker ___

[issue28217] Add interactive console tests

2016-09-20 Thread Eryk Sun
Eryk Sun added the comment: Here's the ctypes code (mentioned on issue 1602) for writing to the input buffer and reading from the screen buffer. For output testing I also have a context manager to create and temporarily activate a new screen buffer with a given number of columns and rows and

[issue28165] The 'subprocess' module leaks memory when called in certain ways

2016-09-20 Thread Xavion
Changes by Xavion : Added file: http://bugs.python.org/file44763/Test-3a-gc.log ___ Python tracker ___

[issue28165] The 'subprocess' module leaks memory when called in certain ways

2016-09-20 Thread Xavion
Changes by Xavion : Added file: http://bugs.python.org/file44762/Test-3a-no-gc.log ___ Python tracker ___

[issue28165] The 'subprocess' module leaks memory when called in certain ways

2016-09-20 Thread Xavion
Xavion added the comment: Firstly, you've misquoted me. The quote you attributed to me in your latest post was actually made by 'ztane'. Secondly, your extra thread/event code makes no difference here. I will attach the memory usage logs in subsequent posts. For consistency, I have removed

Re: How to install Python.h on FreeBSD 10.3-RELEASE?

2016-09-20 Thread Don Kuenz
The Doctor wrote: > In article <201609...@crcomp.net>, Don Kuenz wrote: >> >>It turns out that the question isn't "How to install Python.h?" The >>question is "Why doesn't make find Python.h?" >>

[issue25470] Random Malloc error raised

2016-09-20 Thread STINNER Victor
STINNER Victor added the comment: Python 3.6 got a builtin debugging tool to detect buffer under- and overflow: PYTHONMALLOC=debug https://docs.python.org/dev/whatsnew/3.6.html#pythonmalloc-environment-variable In most cases, an error in PyObject_Free() is a hint of a buffer overflow. So I

[issue27282] Raise BlockingIOError in os.urandom if kernel is not ready

2016-09-20 Thread STINNER Victor
STINNER Victor added the comment: This idea is the PEP 522 which was superseded by the PEP 524 (accepted in Python 3.6) which proposed to make os.urandom() blocking. -- nosy: +haypo resolution: -> rejected status: open -> closed ___ Python tracker

[issue22542] Use arc4random under OpenBSD for os.urandom() if /dev/urandom is not present

2016-09-20 Thread STINNER Victor
STINNER Victor added the comment: "Trying to run the python interpreter in a chroot fails if /dev/urandom is not present." The workaround is simple: fix your chroot to correctly expose /dev/urandom in the chroot. It's a common and known issue, no? Since the issue is almost dead since 2 years

[issue27292] Warn users that os.urandom() prior to 3.6 can return insecure values

2016-09-20 Thread STINNER Victor
STINNER Victor added the comment: > Please ensure that the documentation properly warns users about these edge > cases. I disagree. I don't think that the Python documentation is the right place to document the security level of system urandom. It's just a mess, there are so many corner

Re: automated comparison tool

2016-09-20 Thread Andrew Clark
On Tuesday, September 20, 2016 at 3:25:11 PM UTC-5, Lawrence D’Oliveiro wrote: > On Wednesday, September 21, 2016 at 7:44:22 AM UTC+12, Andrew Clark wrote: > > If anyone can help me out with sudo code or set me in the right direction > > would be nice. > > You know What Aesop said: “the gods*

[issue27990] Provide a way to enable getrandom on Linux even when build system runs an older kernel

2016-09-20 Thread STINNER Victor
STINNER Victor added the comment: I'm not excited by the idea of using hardcoded constants for getrandom(). There is a risk of using wrong constants depending on the architecture or the Linux kernel version. The code is already very low-level: it calls directly the syscall using syscall()

[issue28220] argparse's add_mutually_exclusive_group() should accept title and description

2016-09-20 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: The workaround is to do something like: group = parser.add_argument_group(title, description) me_group = group.add_mutually_exclusive_group() me_group.add_argument(...blah blah blah...) -- ___ Python tracker

[issue27778] PEP 524: Add os.getrandom()

2016-09-20 Thread STINNER Victor
STINNER Victor added the comment: I pushed the fix for the issue #27955, os.urandom() now handles getrandom() failing with EPERM. @Christian: Thanks for your review, I pushed a change fixing the two issues that you reported (memory leak and inefficient temporarily buffer). I attached

[issue27778] PEP 524: Add os.getrandom()

2016-09-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset d31b4de433b7 by Victor Stinner in branch '3.6': Fix memleak in os.getrandom() https://hg.python.org/cpython/rev/d31b4de433b7 -- ___ Python tracker

[issue28220] argparse's add_mutually_exclusive_group() should accept title and description

2016-09-20 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: Hmm, it might be more complicated than that, so let's ignore 3.6 -- versions: -Python 3.6 ___ Python tracker ___

Re: list or dictionary

2016-09-20 Thread Chris Angelico
On Wed, Sep 21, 2016 at 4:04 AM, Ganesh Pal wrote: > 1. store it in list and grep for id and return > 2. store it in dict as key and value i.e hostname = { 'hostname1': 1} and > return key > 3. any other simple options. 4. Store it in dict, but the other way around. The key

[issue28220] argparse's add_mutually_exclusive_group() should accept title and description

2016-09-20 Thread Barry A. Warsaw
New submission from Barry A. Warsaw: I'd love to sneak this into 3.6, but I can accept being too late. In any case, _MutuallyExclusiveGroup.__init__() should accept title and description arguments and pass them to the super class. Otherwise, you can't great a mutually exclusive group that

[issue28213] asyncio SSLProtocol _app_transport is private

2016-09-20 Thread Yury Selivanov
Yury Selivanov added the comment: -1 on exposing app_protocol. It's an implementation detail, starttls should be implemented in asyncio (and while it's not, it's ok to use '_app_protocol'. -- ___ Python tracker

[issue27955] getrandom() syscall returning EPERM make the system unusable.

2016-09-20 Thread STINNER Victor
STINNER Victor added the comment: I modified Python 3.5, 3.6 and 3.7 to fall back on reading /dev/urandom when getrandom() syscall fails with EPERM. Thanks for the bug report iwings! Note: Python 2.7 does not use getrandom() and so is not impacted. Christian: > Did you open a bug with your

[issue27955] getrandom() syscall returning EPERM make the system unusable.

2016-09-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset 41e9e711b9b5 by Victor Stinner in branch '3.5': Cleanup random.c https://hg.python.org/cpython/rev/41e9e711b9b5 New changeset ddc54f08bdfa by Victor Stinner in branch '3.5': Catch EPERM error in py_getrandom()

Re: Another å, ä, ö question

2016-09-20 Thread Chris Angelico
On Wed, Sep 21, 2016 at 6:21 AM, Martin Schöön wrote: > Den 2016-09-19 skrev Lawrence D’Oliveiro : >> On Tuesday, September 20, 2016 at 8:21:25 AM UTC+12, Martin Schöön wrote: >>> But -- now I tested using emacs instead using C-c C-c to execute.

Re: pypy on windows much slower than linux/mac when using complex number type?

2016-09-20 Thread Chris Angelico
On Wed, Sep 21, 2016 at 6:38 AM, Irmen de Jong wrote: > Windows: 64 bits Windows 7, Intel Core 2 Quad 3.4 Ghz > Linux: 32 bits Mint 18, Virtualbox VM on above windows machine > Mac mini: OS X 10.11.6, Intel Core 2 Duo 2.53 Ghz > > The test code I've been using is here:

[issue28207] SQLite headers are not searched in custom locations

2016-09-20 Thread Santiago Castro
Santiago Castro added the comment: I tried with pyenv (https://github.com/yyuu/pyenv): pyenv install 3.5.2. Maybe the error is from their side, but basically it downloads Python and compiles it: https://github.com/yyuu/pyenv/blob/master/plugins/python-build/install.sh#L24 --

pypy on windows much slower than linux/mac when using complex number type?

2016-09-20 Thread Irmen de Jong
Hi, I've stumbled across a peculiar performance issue with Pypy across some different platforms. It was very visible in some calculation heavy code that I wrote that uses Python's complex number type to calculate the well-known Mandelbrot set. Pypy running the code on my Windows machine is

Re: Another å, ä, ö question

2016-09-20 Thread Peter Otten
Martin Schöön wrote: > Den 2016-09-19 skrev Christian Gollwitzer : >> Am 19.09.16 um 22:21 schrieb Martin Schöön: >>> I am studying some of these tutorials: >>> https://pythonprogramming.net/matplotlib-intro-tutorial/ >>> >>> I am recreating the code and I use my native Swedish

Re: list or dictionary

2016-09-20 Thread Lawrence D’Oliveiro
On Wednesday, September 21, 2016 at 6:05:41 AM UTC+12, Ganesh Pal wrote: > I am on python 2.7 ... Why? -- https://mail.python.org/mailman/listinfo/python-list

[issue28212] Closing server in asyncio is not efficient

2016-09-20 Thread Guido van Rossum
Changes by Guido van Rossum : -- nosy: -gvanrossum ___ Python tracker ___ ___

Re: automated comparison tool

2016-09-20 Thread Lawrence D’Oliveiro
On Wednesday, September 21, 2016 at 7:44:22 AM UTC+12, Andrew Clark wrote: > If anyone can help me out with sudo code or set me in the right direction > would be nice. You know What Aesop said: “the gods* help those who help themselves”. Start by posting an initial stab at your code for solving,

Re: Another å, ä, ö question

2016-09-20 Thread Martin Schöön
Den 2016-09-19 skrev Lawrence D’Oliveiro : > On Tuesday, September 20, 2016 at 8:21:25 AM UTC+12, Martin Schöön wrote: >> But -- now I tested using emacs instead using C-c C-c to execute. >> Noting happens so I try to run the program from command line and >> find that now

[issue28212] Closing server in asyncio is not efficient

2016-09-20 Thread Константин Волков
Константин Волков added the comment: Seems that its not so hard - in loop.remove_reader add self._ready.append(reader) after reader.cancel() May be its needed to check that its not already there, but I cant imagine how it can be. 2016-09-20 23:16 GMT+03:00 Andrew Svetlov

Re: Another å, ä, ö question

2016-09-20 Thread Martin Schöön
Den 2016-09-19 skrev Christian Gollwitzer : > Am 19.09.16 um 22:21 schrieb Martin Schöön: >> I am studying some of these tutorials: >> https://pythonprogramming.net/matplotlib-intro-tutorial/ >> >> I am recreating the code and I use my native Swedish for comments, >> labels and

[issue28212] Closing server in asyncio is not efficient

2016-09-20 Thread Andrew Svetlov
Andrew Svetlov added the comment: It's a known annoying issue. Honestly I don't know how to fix it properly. `transport.close()` is affected also because `protocol.connection_lost()` is called on next loop iteration only. Adding a small `asyncio.sleep()` between finishing all worn and loop

Re: I am newbie who can explain this code to me?

2016-09-20 Thread Peter Otten
Nobody wrote: > On Tue, 20 Sep 2016 15:12:39 +0200, Peter Otten wrote: > >> because they don't build lists only to throw them away. > > The lists could have been avoided by using iterators, e.g. > > import itertools as it > keys = xrange(256) > vals = it.imap(chr, keys) >

[issue28213] asyncio SSLProtocol _app_transport is private

2016-09-20 Thread Guido van Rossum
Changes by Guido van Rossum : -- nosy: +asvetlov ___ Python tracker ___ ___

Re: how to automate java application in window using python

2016-09-20 Thread Lawrence D’Oliveiro
On Sunday, September 18, 2016 at 10:42:16 PM UTC+12, Paul Rubin wrote: > > Lawrence D’Oliveiro writes: >> > I'm quite sure there are Java bindings for all those protocols. Are any of these supported by the Java app in question? Doesn’t seem like it. >> Like I said, trying to automate a GUI is a

Re: how to automate java application in window using python

2016-09-20 Thread Lawrence D’Oliveiro
On Tuesday, September 20, 2016 at 1:11:20 PM UTC+12, Ned Batchelder wrote: > We get it, you don't like GUIs. Who says I don’t like GUIs ? I just assume we’ve moved on from the 1990s, when they were considered to be the

Re: Idiomatic code validator?

2016-09-20 Thread Tim Johnson
* Terry Reedy [160920 11:48]: > On 9/20/2016 11:41 AM, Tim Johnson wrote: > > Not to confuse idiomatic code validation with pep8 validation > > Strictly speaking, there cannot be a mechanical PEP 8 validator, as any > mechanical checker violates the admonitions of the beginning

[issue28219] Is order of argparse --help output officially defined?

2016-09-20 Thread Barry A. Warsaw
New submission from Barry A. Warsaw: Sometimes we want to control the order of arguments printed by an argparse defined cli. In practice, arguments are printed in the order in which they are added via add_argument(), but I don't think this is documented and thus should be considered an

automated comparison tool

2016-09-20 Thread Andrew Clark
I'm trying to develop a tool in python that will allow me to compare two file. I know this sounds like it's been done before but there is a catch. Files are stored on a remote server. There are three separate directories. StartupConfig, RunningConfig, and ArchiveConfig I need to have the python

Re: Idiomatic code validator?

2016-09-20 Thread Terry Reedy
On 9/20/2016 11:41 AM, Tim Johnson wrote: Not to confuse idiomatic code validation with pep8 validation Strictly speaking, there cannot be a mechanical PEP 8 validator, as any mechanical checker violates the admonitions of the beginning sections 'Introductions' and 'A Foolish Consistency is

Re: I am newbie who can explain this code to me?

2016-09-20 Thread Nobody
On Tue, 20 Sep 2016 15:12:39 +0200, Peter Otten wrote: > because they don't build lists only to throw them away. The lists could have been avoided by using iterators, e.g. import itertools as it keys = xrange(256) vals = it.imap(chr, keys) max(it.imap(operator.setitem, it.repeat(d), keys,

[issue27923] PEP 467 -- Minor API improvements for binary sequences

2016-09-20 Thread Elias Zamaria
Elias Zamaria added the comment: Ethan, by "Ned", I am guessing that you are referring to Ned Batchelder. Is that right? If so, do we need to put him on the nosy list or do anything else to bring this to his attention? -- ___ Python tracker

[issue15797] bdist_msi does not pass -install/remove flags to install_script

2016-09-20 Thread Petri Savolainen
Petri Savolainen added the comment: If I understood the patch correctly, while adding the '-install' and '-remove' arguments, the patch also removes sys.argv[0], ie. the (install) script name. Why? That also changes the the documented behavior. The patch also appears to add an uninstall

[issue28218] Windows docs have wrong versionadded description

2016-09-20 Thread Steve Dower
New submission from Steve Dower: At https://docs.python.org/3.6/using/windows.html#finding-modules the versionadded description needs the reference to `sys.path file` removed. -- assignee: steve.dower messages: 277058 nosy: steve.dower priority: normal severity: normal stage: needs

Re: I am newbie who can explain this code to me?

2016-09-20 Thread Terry Reedy
On 9/20/2016 9:12 AM, Peter Otten wrote: 在 2016年9月20日星期二 UTC-4上午8:17:13,BartC写道: On 20/09/2016 13:12, 38016226...@gmail.com wrote: d = {} keys = range(256) vals = map(chr, keys) map(operator.setitem, [d]*len(keys), keys, vals) It is from python library. What does [d]*len(keys) mean? d is

[issue15797] bdist_msi does not pass -install/remove flags to install_script

2016-09-20 Thread Petri Savolainen
Petri Savolainen added the comment: Any chance the patch could be processed? -- nosy: +petri versions: +Python 3.4, Python 3.5 ___ Python tracker ___

[issue28215] PyModule_AddIntConstant() wraps >=2^31 values when long is 4 bytes

2016-09-20 Thread Kyle Altendorf
Kyle Altendorf added the comment: A little macro funny business gets a function the ability to know if the type passed to its wrapping macro is signed or not. http://ideone.com/NZYs7u // http://stackoverflow.com/questions/7469915 #define IS_UNSIGNED(v) (v >= 0 && ~v >= 0) #define F(v)

[issue28216] micro optimization for import_all_from

2016-09-20 Thread Xiang Zhang
Xiang Zhang added the comment: As pointed out by Serhiy, PyObject_GetAttr may change __all__ so my proposal is not going to work. Close this and sorry for noise. :-( -- resolution: -> rejected stage: patch review -> resolved status: open -> closed

list or dictionary

2016-09-20 Thread Ganesh Pal
I am on python 2.7 and Linux I have the stdout in the below form , I need to write a function to get hostname for the given id. Example: >>> stdout 'hostname-1 is array with id 1\nhostname-2 is array with id 2\nhostname-3 is array with id 3\n' def get_hostname(id) return id what's a

[issue28214] Improve exception reporting for problematic __set_name__ attributes

2016-09-20 Thread Eric Snow
Eric Snow added the comment: I agree with Serhiy that __set_name__ should be looked up on the class like all other special methods. Pickle is a great example why lookup (of __reduce__) on the instance is a pain. -- nosy: +eric.snow ___ Python

[issue28215] PyModule_AddIntConstant() wraps >=2^31 values when long is 4 bytes

2016-09-20 Thread Kyle Altendorf
Kyle Altendorf added the comment: I do not seem to be getting a compiler warning. arm-fsl-linux-gnueabi-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes-Werror=declaration-after-statement -I. -IInclude -I./Include

[issue28215] PyModule_AddIntConstant() wraps >=2^32 values when long is 4 bytes

2016-09-20 Thread Christian Heimes
Christian Heimes added the comment: Oh sorry, I missed the point that you are talking about an existing constant in the socket module. At first I thought that you were referring to a constant that you have added. It sounds like a bug for constants >= 2**31. -- nosy: +haypo

[issue1602] windows console doesn't print or input Unicode

2016-09-20 Thread Steve Dower
Steve Dower added the comment: Created issue28217 for adding these tests. -- superseder: -> Add interactive console tests ___ Python tracker ___

  1   2   >