Re: Code Snippets

2017-11-01 Thread Ned Batchelder
On 11/1/17 1:25 PM, Stefan Ram wrote: I started to collect some code snippets: Sleep one second __import__( "time" ).sleep( 1 ) Get current directory __import__( "os" ).getcwd() Get a random number __import__( "random" ).random() And so on. You get the idea. However,

[issue27666] "stack smashing detected" in PyCursesWindow_Box

2017-11-01 Thread Roundup Robot
Change by Roundup Robot : -- pull_requests: +4189 ___ Python tracker ___

[issue1751519] curses - new window methods: addchstr and addchnstr

2017-11-01 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- versions: +Python 3.7 -Python 3.2 ___ Python tracker ___

[issue1751519] curses - new window methods: addchstr and addchnstr

2017-11-01 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- assignee: -> serhiy.storchaka nosy: +serhiy.storchaka ___ Python tracker ___

Re: String changing size on failure?

2017-11-01 Thread Skip Montanaro
Leave it to DB to ask the tough questions other people won't. :-) Skip On Wed, Nov 1, 2017 at 2:26 PM, Ned Batchelder wrote: > From David Beazley (https://twitter.com/dabeaz/status/925787482515533830): > > >>> a = 'n' > >>> b = 'ñ' > >>> sys.getsizeof(a) >

Re: String changing size on failure?

2017-11-01 Thread Chris Angelico
On Thu, Nov 2, 2017 at 7:34 AM, Ned Batchelder wrote: > On 11/1/17 4:17 PM, MRAB wrote: >> >> On 2017-11-01 19:26, Ned Batchelder wrote: >>> >>> From David Beazley >>> (https://twitter.com/dabeaz/status/925787482515533830): >>> >>> >>> a = 'n' >>> >>> b = 'ñ'

Re: Code Snippets

2017-11-01 Thread Irmen de Jong
On 11/01/2017 06:25 PM, Stefan Ram wrote: > import random > ... > random.random() > > Now, the user has to cut the import, paste it to the top > of his code, then go back to the list of snippets, find > the same snippet again, copy the expression, go to his code, > then find the point

[issue31630] math.tan has poor accuracy near pi/2 on OpenBSD and NetBSD

2017-11-01 Thread Tim Peters
Tim Peters added the comment: Since fdlibm uses tan(x) ~= -1/(x-pi/2) in this range, and the reciprocals of the bad results have a whole of bunch of trailing zero bits, my guess is that argument reduction (the "x-pi/2" part) is screwing up (losing bits of pi/2 beyond the

[issue28643] Broken makefile depends for profile-opt target

2017-11-01 Thread Neil Schemenauer
Change by Neil Schemenauer : -- keywords: +patch pull_requests: +4191 ___ Python tracker ___

[issue31630] math.tan has poor accuracy near pi/2 on OpenBSD and NetBSD

2017-11-01 Thread Stefan Krah
Stefan Krah added the comment: On Wed, Nov 01, 2017 at 06:17:44PM +, Mark Dickinson wrote: > I'm really reluctant to (even conditionally) skip the test, because it's > doing exactly what it's designed to do, namely detecting and reporting that > Python is giving poor

Re: Report on non-breaking spaces in posts

2017-11-01 Thread Ned Batchelder
On 10/31/17 1:23 PM, Stefan Ram wrote: Ok, here's a report on me seing non-breaking spaces in posts in this NG. I have written this report so that you can see that it's not my newsreader that is converting something, because there is no newsreader involved. You've worded this as if

Re: Code Snippets

2017-11-01 Thread Wolfgang Maier
On 01.11.2017 18:25, Stefan Ram wrote: I started to collect some code snippets: Sleep one second __import__( "time" ).sleep( 1 ) Get current directory __import__( "os" ).getcwd() Get a random number __import__( "random" ).random() And so on. You get the idea. However,

replacing `else` with `then` in `for` and `try`

2017-11-01 Thread Alexey Muranov
Hello, what do you think about the idea of replacing "`else`" with "`then`" in the contexts of `for` and `try`? It seems clear that it should be rather "then" than "else." Compare also "try ... then ... finally" with "try ... else ... finally". Currently, with "else", it is almost

Re: replacing `else` with `then` in `for` and `try`

2017-11-01 Thread Ned Batchelder
On 11/1/17 5:12 PM, Alexey Muranov wrote: Hello, what do you think about the idea of replacing "`else`" with "`then`" in the contexts of `for` and `try`? It seems clear that it should be rather "then" than "else." Compare also "try ... then ... finally" with "try ... else ... finally".

Re: Thread safety issue (I think) with defaultdict

2017-11-01 Thread Israel Brewster
On Nov 1, 2017, at 9:58 AM, Ian Kelly wrote: > > On Tue, Oct 31, 2017 at 11:38 AM, Israel Brewster > wrote: >> A question that has arisen before (for example, here: >> https://mail.python.org/pipermail/python-list/2010-January/565497.html >>

[issue5368] curses patch add color_set and wcolor_set , and addchstr family of functions

2017-11-01 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- versions: +Python 3.7 -Python 2.7 ___ Python tracker ___

[issue21457] NetBSD curses support improvements

2017-11-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Guards around functions have been removed in issue31891. But could you please explain why changes in py_curses.h are needed? -- nosy: +serhiy.storchaka ___ Python tracker

Re: replacing `else` with `then` in `for` and `try`

2017-11-01 Thread Chris Angelico
On Thu, Nov 2, 2017 at 8:23 AM, Ned Batchelder wrote: > On 11/1/17 5:12 PM, Alexey Muranov wrote: >> >> Hello, >> >> what do you think about the idea of replacing "`else`" with "`then`" in >> the contexts of `for` and `try`? >> >> It seems clear that it should be rather

[issue18669] curses.chgat() moves cursor, documentation says it shouldn't

2017-11-01 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- assignee: docs@python -> serhiy.storchaka nosy: +serhiy.storchaka ___ Python tracker ___

String changing size on failure?

2017-11-01 Thread Ned Batchelder
From David Beazley (https://twitter.com/dabeaz/status/925787482515533830): >>> a = 'n' >>> b = 'ñ' >>> sys.getsizeof(a) 50 >>> sys.getsizeof(b) 74 >>> float(b) Traceback (most recent call last):   File "", line 1, in ValueError: could not convert string to

Re: String changing size on failure?

2017-11-01 Thread Ned Batchelder
On 11/1/17 4:17 PM, MRAB wrote: On 2017-11-01 19:26, Ned Batchelder wrote:   From David Beazley (https://twitter.com/dabeaz/status/925787482515533830):   >>> a = 'n'   >>> b = 'ñ'   >>> sys.getsizeof(a) 50   >>> sys.getsizeof(b) 74   >>> float(b) Traceback

Re: String changing size on failure?

2017-11-01 Thread Grant Edwards
On 2017-11-01, Ned Batchelder wrote: > On 11/1/17 4:17 PM, MRAB wrote: >> On 2017-11-01 19:26, Ned Batchelder wrote: >>>   From David Beazley >>> (https://twitter.com/dabeaz/status/925787482515533830): >>> >>>   >>> a = 'n' >>>   >>> b = 'ñ' >>>   >>>

Re: Code Snippets

2017-11-01 Thread Chris Angelico
On Thu, Nov 2, 2017 at 8:02 AM, Ben Bacarisse wrote: > r...@zedat.fu-berlin.de (Stefan Ram) writes: > >> Wolfgang Maier writes: >>>If you're worried bout having things on separate lines, you could write: >>>import os; os.getcwd()

[issue31630] math.tan has poor accuracy near pi/2 on OpenBSD and NetBSD

2017-11-01 Thread Tim Peters
Tim Peters added the comment: Oops! I mixed up `sin` and `cos` in that comment. If it's argument reduction that's broken, then for x near pi/2 cos(x) will be evaluated as -sin(x - pi/2), which is approximately -(x - pi/2), and so error in argument reduction (the "x - pi/2"

Re: Code Snippets

2017-11-01 Thread Chris Angelico
On Thu, Nov 2, 2017 at 7:17 AM, Stefan Ram wrote: > Wolfgang Maier writes: >>If you're worried bout having things on separate lines, you could write: >>import os; os.getcwd() >>,etc., which is actually saving a few characters :) >

[issue18835] Add PyMem_AlignedAlloc()

2017-11-01 Thread Stefan Krah
Stefan Krah added the comment: Yes, it may be better not to add it. To summarize the problems again: - C11 aligned_alloc() / free() would be more comfortable but isn't available on MSVC. - posix_memalign() performance isn't that

Re: replacing `else` with `then` in `for` and `try`

2017-11-01 Thread Chris Angelico
On Thu, Nov 2, 2017 at 8:12 AM, Alexey Muranov wrote: > Hello, > > what do you think about the idea of replacing "`else`" with "`then`" in the > contexts of `for` and `try`? > > It seems clear that it should be rather "then" than "else." Compare also > "try ... then ...

[issue27666] "stack smashing detected" in PyCursesWindow_Box

2017-11-01 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

Re: String changing size on failure?

2017-11-01 Thread Chris Angelico
On Thu, Nov 2, 2017 at 6:26 AM, Ned Batchelder wrote: > From David Beazley (https://twitter.com/dabeaz/status/925787482515533830): > > >>> a = 'n' > >>> b = 'ñ' > >>> sys.getsizeof(a) >50 > >>> sys.getsizeof(b) >74 > >>> float(b) >Traceback

Re: String changing size on failure?

2017-11-01 Thread MRAB
On 2017-11-01 19:26, Ned Batchelder wrote: From David Beazley (https://twitter.com/dabeaz/status/925787482515533830): >>> a = 'n' >>> b = 'ñ' >>> sys.getsizeof(a) 50 >>> sys.getsizeof(b) 74 >>> float(b) Traceback (most recent call last):  

[issue14598] _cursesmodule.c fails with ncurses-5.9 on Linux

2017-11-01 Thread Masayuki Yamamoto
Masayuki Yamamoto added the comment: Probably, yes. ncurses on Cygwin has provided is_pad() [*]. In addition, the old version of Cygwin will become to not define WINDOW_HAS_FLAGS by issue25720. [*] newer version than patchlevel 20090906 was provided on Cygwin in

Re: Code Snippets

2017-11-01 Thread Ben Bacarisse
r...@zedat.fu-berlin.de (Stefan Ram) writes: > Wolfgang Maier writes: >>If you're worried bout having things on separate lines, you could write: >>import os; os.getcwd() >>,etc., which is actually saving a few characters :) > > Yes, but there still is

Re: String changing size on failure?

2017-11-01 Thread David Beazley
Nah. I discuss this behavior (caching of UTF-8 conversions in the C API) in section 15.14 of the Python Cookbook. The tweet was a tutorial, not a question ;-). Admittedly, an evil tutorial... Cheers, Dave > On Nov 1, 2017, at 2:53 PM, Skip Montanaro wrote: > >

Re: replacing `else` with `then` in `for` and `try`

2017-11-01 Thread Ned Batchelder
On 11/1/17 5:29 PM, Chris Angelico wrote: On Thu, Nov 2, 2017 at 8:23 AM, Ned Batchelder wrote: On 11/1/17 5:12 PM, Alexey Muranov wrote: Hello, what do you think about the idea of replacing "`else`" with "`then`" in the contexts of `for` and `try`? It seems clear

[issue31356] Add context manager to temporarily disable GC

2017-11-01 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: I have prepared a PR in GitHub with an initial implementation of the context manager trying to fulfil the discussed requirements: https://github.com/python/cpython/pull/3980 -- nosy: +pablogsal

Re: Thread safety issue (I think) with defaultdict

2017-11-01 Thread Steve D'Aprano
On Thu, 2 Nov 2017 05:53 am, Israel Brewster wrote: [...] > So the end result is that the thread that "updates" the dictionary, and the > thread that initially *populates* the dictionary are actually running in > different processes. If they are in different processes, that would explain why the

Re: replacing `else` with `then` in `for` and `try`

2017-11-01 Thread Steve D'Aprano
On Thu, 2 Nov 2017 08:12 am, Alexey Muranov wrote: > Hello, > > what do you think about the idea of replacing "`else`" with "`then`" in > the contexts of `for` and `try`? Yes, this, exactly!!! (For while and for loops, but not try -- see below.) I have argued this for many years. The current

what exactly does type.__call__ do?

2017-11-01 Thread Jason Maldonis
Hi everyone, I want to use a metaclass to override how class instantiation works. I've done something analogous to using the Singleton metaclass from the Python3 Cookbook example. However, I want to provide a classmethod that allows for "normal" class instantiation that prevents this metaclass

[issue31913] forkserver could warn if several threads are running

2017-11-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: Yeah... We might replicate the psutil source code doing that. On Linux, it involves parsing /proc/{pid}/status (which may not be available on some restricted execution environments?). Haven't looked what it does on macOS. -- nosy:

[issue31913] forkserver could warn if several threads are running

2017-11-01 Thread Gregory P. Smith
Gregory P. Smith added the comment: If we do this, I think we should aim for the complete solution on the most common posix platforms (Linux and MacOS) as C/C++ extensions are just as happy to create threads these days. (but if you want to start with a simple python threads

[issue31356] Add context manager to temporarily disable GC

2017-11-01 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- keywords: +patch pull_requests: +4192 stage: needs patch -> patch review ___ Python tracker

[issue21457] NetBSD curses support improvements

2017-11-01 Thread Thomas Klausner
Thomas Klausner added the comment: Thanks for looking at this. I looked at the patch again, and I can't make sense of the py_curses.h part either - I've removed it from pkgsrc with a request for information if it's still needed. Btw, thanks for working on NetBSD curses

Re: matplot plot hangs

2017-11-01 Thread Andrew Z
nope. it doesnt: I added print-s after each line and that produced: [az@hp src]$ cat ./main1.py import matplotlib.pyplot as plt print("imported") plt.plot([1,2,4,1]) print("plot is done") plt.show() print("show is done") [az@hp src]$ python3.5 ./main1.py imported ^C^Z [1]+ Stopped

Re: what exactly does type.__call__ do?

2017-11-01 Thread Jason Maldonis
Thanks for the reply. And I think I wasn't clear enough. I was wondering what the metaclass `type`'s `type.__call__` does explicitly. I'm reasonably comfortable writing metaclasses when I need them, and I understand how `.__call__` works for non-metaclass objects. In my first email I gave three

Re: Code Snippets

2017-11-01 Thread Steve D'Aprano
On Thu, 2 Nov 2017 04:25 am, Stefan Ram wrote: > I started to collect some code snippets: [...] > __import__( "random" ).random() > > And so on. You get the idea. > > However, reportedly, all those snippets are anti-patterns > because they use »__import__«. Correct. Nearly all dunder

[issue18835] Add PyMem_AlignedAlloc()

2017-11-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: I agree, if the two primary users say they won't use it, it doesn't make sense for us to maintain 600 hundred lines of low-level C code. -- ___ Python tracker

Re: Let's talk about debuggers!

2017-11-01 Thread dieter
Thomas Jollans writes: > I just wanted to know what tools everyone used for debugging Python > applications - scripts / backend / desktop apps / notebooks / whatever. > Apart from the usual dance with log files and strategically inserted > print() calls, that is. > > Of course we

[issue31918] Don't let all python code modify modules

2017-11-01 Thread Марат Нагаев
Change by Марат Нагаев : -- components: +Extension Modules ___ Python tracker ___

[issue31626] Writing in freed memory in _PyMem_DebugRawRealloc() after shrinking a memory block

2017-11-01 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +4179 ___ Python tracker ___ ___

Re: Objects with __name__ attribute

2017-11-01 Thread dieter
"ast" writes: > I know two Python's objects which have an intrinsic name, classes and > functions. > ... > Are there others objects with a __name__ attribute > and what is it used for ? Some Python objects naturally have a name: functions, classes, modules, ...; others don't:

Re: matplot plot hangs

2017-11-01 Thread Wolfgang Maier
On 01.11.2017 00:40, Andrew Z wrote: hello, learning python's plotting by using matplotlib with python35 on fedora 24 x86. Installed matplotlib into user's directory. tk, seemed to work - http://www.tkdocs.com/tutorial/install.html#installlinux - the window shows up just fine. but when trying

[issue31918] D

2017-11-01 Thread Марат Нагаев
Change by Марат Нагаев : -- nosy: Марат Нагаев priority: normal severity: normal status: open title: D type: enhancement ___ Python tracker

Re: right list for SIGABRT python binary question ?

2017-11-01 Thread Karsten Hilbert
On Wed, Nov 01, 2017 at 10:27:54AM +0100, Karsten Hilbert wrote: > > >> It points to a memory corruption. > > > > The i386/x64 architecture supports memory access breakpoints > > and GDB, too, has support for this. You know the address which > > gets corrupted. Thus, the following apporach could

[issue30442] Skip test_xml_etree under coverage

2017-11-01 Thread Berker Peksag
Berker Peksag added the comment: All PRs have been merged and 3.5 is now in security-fix-only mode. Closing this as 'fixed'. -- nosy: +berker.peksag resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.5

[issue31919] Make curses compiling on OpenIndiana and tests passing

2017-11-01 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : The proposed PR makes curses compiling on OpenIndiana (2017.04) and fixes tests. I suppose it fixes issues on Solaris too. -- assignee: serhiy.storchaka components: Extension Modules messages: 305368 nosy:

[issue31390] pydoc.Helper.keywords missing async and await

2017-11-01 Thread Berker Peksag
Berker Peksag added the comment: Thank you for your report. Prior to Python 3.7, async and await keywords have had special meanings and they weren't treated as normal keywords. They are now in Python 3.7: >>> async = 42 File "", line 1 async = 42 ^

[issue31412] wave.open does not accept PathLike objects

2017-11-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: wave is a one of three audio file modules (aifc, sunau, wave) that should have the same interface. -- nosy: +serhiy.storchaka ___ Python tracker

[issue31908] trace module cli does not write cover files

2017-11-01 Thread Berker Peksag
Berker Peksag added the comment: I think the first part of your patch also fixes issue 26818. Could you adapt the test there and add a test case for the problem in this issue? -- nosy: +berker.peksag versions: -Python 3.5

[issue9674] make install DESTDIR=/home/blah fails when the prefix specified is /

2017-11-01 Thread Xavier de Gaye
Xavier de Gaye added the comment: The problem is that the build system , Py_GetPath() and the distutils module do not handle correctly the case where the configure prefix is '/'. Closing as a duplicate of issue 31114. -- resolution: -> duplicate stage: test needed

[issue31412] wave.open does not accept PathLike objects

2017-11-01 Thread Berker Peksag
Change by Berker Peksag : -- nosy: +berker.peksag ___ Python tracker ___ ___

Re: right list for SIGABRT python binary question ?

2017-11-01 Thread dieter
Karsten Hilbert writes: > On Sat, Oct 21, 2017 at 09:31:54AM +0200, dieter wrote: >> It points to a memory corruption. > While running valgrind and friends is beyond my capabilitis I > have run the problem through gdb to at least obtain a stack > trace to see what gives:

Re: Performance of map vs starmap.

2017-11-01 Thread Serhiy Storchaka
30.10.17 12:10, Kirill Balunov пише: Sometime ago I asked this question at SO [1], and among the responses received was paragraph: - `zip` re-uses the returned `tuple` if it has a reference count of 1 when the `__next__` call is made. - `map` build a new `tuple` that is passed to the mapped

Re: right list for SIGABRT python binary question ?

2017-11-01 Thread Karsten Hilbert
On Wed, Nov 01, 2017 at 09:21:46AM +0100, dieter wrote: > >> It points to a memory corruption. > > The i386/x64 architecture supports memory access breakpoints > and GDB, too, has support for this. You know the address which > gets corrupted. Thus, the following apporach could have a chance > to

[issue31918] Don't let all python code modify modules

2017-11-01 Thread Марат Нагаев
New submission from Марат Нагаев : import os os="os" #I think it's bad, os and other modules constants -- title: D -> Don't let all python code modify modules ___ Python tracker

[issue31918] Don't let all python code modify modules

2017-11-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: You haven't modified the os module. You have just binded a new value to the os variable. You can assign arbitrary values to your variables, this is a feature of Python. -- nosy: +serhiy.storchaka resolution: -> not a

Re: right list for SIGABRT python binary question ?

2017-11-01 Thread Karsten Hilbert
On Wed, Nov 01, 2017 at 11:14:08AM +0100, Karsten Hilbert wrote: > Or rather: I need to find out which "place" a given address > refers to, check whether the changing addresses always belong > to the same "place" between runs and _then_ map a "place" to > its address and breakpoint that address

[issue28791] update sqlite to latest version before beta 1

2017-11-01 Thread Berker Peksag
Berker Peksag added the comment: > In an effort to not forget about this, I'm setting it to deferred blocker. Should we mark issue 30952 'deferred blocker' too? -- nosy: +berker.peksag ___ Python tracker

Re: Code Snippets

2017-11-01 Thread Steve D'Aprano
On Thu, 2 Nov 2017 08:02 am, Ben Bacarisse wrote: > r...@zedat.fu-berlin.de (Stefan Ram) writes: > >> Wolfgang Maier writes: >>>If you're worried bout having things on separate lines, you could write: >>>import os; os.getcwd() >>>,etc., which is actually

Re: what exactly does type.__call__ do?

2017-11-01 Thread Steve D'Aprano
On Thu, 2 Nov 2017 10:13 am, Jason Maldonis wrote: > Hi everyone, > > I want to use a metaclass to override how class instantiation works. I've > done something analogous to using the Singleton metaclass from the Python3 > Cookbook example. In my opinion, nine times out of ten, using a

Re: replacing `else` with `then` in `for` and `try`

2017-11-01 Thread Chris Angelico
On Thu, Nov 2, 2017 at 12:19 PM, Steve D'Aprano wrote: > On Thu, 2 Nov 2017 08:21 am, Chris Angelico wrote: > >> With the 'for' loop, >> it's a bit more arguable, but I've never seen anything more than a >> weak argument in favour of 'then' > > Thhpptpt! > > "else" is

Re: what exactly does type.__call__ do?

2017-11-01 Thread Jason Maldonis
Ok no worries then! Thanks for the tips. I might wait until tomorrow then until someone comes along who deals with metaclasses and alternate class constructors. In case you're curious, I'm doing two things that are relevant here, and I'll link the python3 cookbook examples that are super useful

Re: replacing `else` with `then` in `for` and `try`

2017-11-01 Thread bartc
On 02/11/2017 01:19, Steve D'Aprano wrote: On Thu, 2 Nov 2017 08:21 am, Chris Angelico wrote: With the 'for' loop, it's a bit more arguable, but I've never seen anything more than a weak argument in favour of 'then' Thhpptpt! "else" is an completely inappropriate term that doesn't describe

Re: replacing `else` with `then` in `for` and `try`

2017-11-01 Thread bartc
On 02/11/2017 01:06, Steve D'Aprano wrote: On Thu, 2 Nov 2017 08:12 am, Alexey Muranov wrote: Hello, what do you think about the idea of replacing "`else`" with "`then`" in the contexts of `for` and `try`? Yes, this, exactly!!! (For while and for loops, but not try -- see below.) I have

Re: replacing `else` with `then` in `for` and `try`

2017-11-01 Thread Steve D'Aprano
On Thu, 2 Nov 2017 08:21 am, Chris Angelico wrote: > With the 'for' loop, > it's a bit more arguable, but I've never seen anything more than a > weak argument in favour of 'then' Thhpptpt! "else" is an completely inappropriate term that doesn't describe the semantics of the statement even a

Re: replacing `else` with `then` in `for` and `try`

2017-11-01 Thread Steve D'Aprano
On Thu, 2 Nov 2017 08:23 am, Ned Batchelder wrote: > Apart from the questions of backward compatibility etc (Python is > unlikely to ever go through another shift like the 2/3 breakage), are > you sure "then" is what you mean?  This won't print "end": > > for i in range(10): > print(i) >

Re: replacing `else` with `then` in `for` and `try`

2017-11-01 Thread Ben Bacarisse
Steve D'Aprano writes: > On Thu, 2 Nov 2017 08:12 am, Alexey Muranov wrote: > >> what do you think about the idea of replacing "`else`" with "`then`" in >> the contexts of `for` and `try`? > > Yes, this, exactly!!! > > (For while and for loops, but not try -- see

Re: replacing `else` with `then` in `for` and `try`

2017-11-01 Thread Steve D'Aprano
On Thu, 2 Nov 2017 12:50 pm, Ben Bacarisse wrote: > Steve D'Aprano writes: > >> On Thu, 2 Nov 2017 08:12 am, Alexey Muranov wrote: >> >>> what do you think about the idea of replacing "`else`" with "`then`" in >>> the contexts of `for` and `try`? [...] > Re-using

Re: Code Snippets

2017-11-01 Thread Steve D'Aprano
On Thu, 2 Nov 2017 05:57 am, Stefan Ram wrote: > I also have heard that there was a module cache, so I > was hoping that a second import of the same module might > not be such an effort for the implementation. There is: sys.modules. Although `import spam` is cheap when spam is in the cache,

Re: replacing `else` with `then` in `for` and `try`

2017-11-01 Thread Skip Montanaro
I don't know. The word "then" doesn't connote different ways of exiting a loop to me ("else" doesn't really either, I will grant you that, but it's what we have). Here's how I would read things: - *while* some condition holds, execute the loop, possibly breaking out, *then* do some

[issue8548] Building on CygWin 1.7: PATH_MAX redefined

2017-11-01 Thread Masayuki Yamamoto
Masayuki Yamamoto added the comment: This issue has been out-of-date since Python 3.4 maintenance became security status. -- ___ Python tracker

[issue31872] SSL BIO is broken for internationalized domains

2017-11-01 Thread Nathaniel Smith
Nathaniel Smith added the comment: I believe https://github.com/python/cpython/pull/3010 is the fix you're looking for. -- nosy: +njs ___ Python tracker

[issue25720] Fix curses module compilation with ncurses6

2017-11-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 6ba0b583d6785a256b17d27431908d67015eeeb6 by Serhiy Storchaka (Miss Islington (bot)) in branch '2.7': bpo-25720: Fix the method for checking pad state of curses WINDOW (GH-4164) (#4213)

[issue25720] Fix curses module compilation with ncurses6

2017-11-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset ff6ae4de3874f4922a5883f08bb661c93834b060 by Serhiy Storchaka (Miss Islington (bot)) in branch '3.6': bpo-25720: Fix the method for checking pad state of curses WINDOW (GH-4164) (#4212)

[issue25720] Fix curses module compilation with ncurses6

2017-11-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your contribution Masayuki! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue31910] test_socket.test_create_connection() failed with EADDRNOTAVAIL (err 99)

2017-11-01 Thread STINNER Victor
STINNER Victor added the comment: New changeset 4b73a79e796c3832be0cfd45bc27f15aea32b621 by Victor Stinner (Miss Islington (bot)) in branch '2.7': Fix test_socket.test_create_connection() (GH-4206) (#4209)

[issue31910] test_socket.test_create_connection() failed with EADDRNOTAVAIL (err 99)

2017-11-01 Thread STINNER Victor
STINNER Victor added the comment: New changeset 89b84b026b389f3c61cbbc5ee89afd8248721b0d by Victor Stinner (Miss Islington (bot)) in branch '3.6': Fix test_socket.test_create_connection() (GH-4206) (#4208)

[issue31892] ssl.get_server_certificate should allow specifying certificate / key type

2017-11-01 Thread Christian Heimes
Christian Heimes added the comment: Thanks for your feature request, Hanno. It's fairly easy to implement with current API for TLS protocols up to TLS 1.2, e.g. cipher suite "DEFAULT:!aRSA:!aDSS" or "aECDSA:!NULL" for ECDSA certs. However TLS 1.3 cipher suites no longer

[issue25720] Fix curses module compilation with ncurses6

2017-11-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 8bc7d63560024681dce9f40445f2877b2987e92c by Serhiy Storchaka (Masayuki Yamamoto) in branch 'master': bpo-25720: Fix the method for checking pad state of curses WINDOW (#4164)

[issue31919] Make curses compiling on OpenIndiana and tests passing

2017-11-01 Thread Roundup Robot
Change by Roundup Robot : -- pull_requests: +4184 ___ Python tracker ___

[issue31919] Make curses compiling on OpenIndiana and tests passing

2017-11-01 Thread Roundup Robot
Change by Roundup Robot : -- pull_requests: +4183 ___ Python tracker ___

[issue14598] _cursesmodule.c fails with ncurses-5.9 on Linux

2017-11-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Is this issue superseded by issue25720? -- nosy: +serhiy.storchaka status: open -> pending versions: +Python 3.6, Python 3.7 -Python 3.4, Python 3.5 ___ Python tracker

Re: matplot plot hangs

2017-11-01 Thread Vlastimil Brom
2017-11-01 13:49 GMT+01:00 Andrew Z : > Wolfgang, > I tried to ran from ide with no rwsults, so now im trying from a terminal > in xwindow. > The .plot is the last line in the script and it does hang trying to execute > it. > > > On Nov 1, 2017 05:44, "Wolfgang Maier" < >

[issue31680] Expose curses library name and version on Python level

2017-11-01 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +4185 stage: -> patch review ___ Python tracker ___

[issue30423] [asyncio] orphan future close loop and cause "RuntimeError: Event loop stopped before Future completed."

2017-11-01 Thread Andrew Svetlov
Andrew Svetlov added the comment: New changeset d1e34031f68a3c7523a5376575c87cd0fea2425c by Andrew Svetlov (jimmylai) in branch 'master': [asyncio] bpo-30423: add regression test for orphan future causes "RuntimeError: Event loop stopped before Future completed."

Re: The syntax of replacement fields in format strings

2017-11-01 Thread Ned Batchelder
On 10/31/17 12:45 PM, John Smith wrote: If we keep the current implementation as is, perhaps the documentation should at least be altered ? John, it looks like you are responding to a Python-Dev message, but on this list, somehow... --Ned. --

[issue31919] Make curses compiling on OpenIndiana and tests passing

2017-11-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 87c66e46ce2c929540a9a91bbe25d1840d194475 by Serhiy Storchaka (Miss Islington (bot)) in branch '2.7': bpo-31919: Fix building the curses module on OpenIndiana. (GH-4211) (#4216)

[issue31919] Make curses compiling on OpenIndiana and tests passing

2017-11-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 2be9a31213e93e26a71150efaef1a975f8b9afec by Serhiy Storchaka (Miss Islington (bot)) in branch '3.6': bpo-31919: Fix building the curses module on OpenIndiana. (GH-4211) (#4215)

[issue31919] Make curses compiling on OpenIndiana and tests passing

2017-11-01 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +4180 stage: -> patch review ___ Python tracker ___

Re: right list for SIGABRT python binary question ?

2017-11-01 Thread Karsten Hilbert
On Wed, Nov 01, 2017 at 12:40:56PM +0100, Karsten Hilbert wrote: > Interestingly, on subsequent runs, it seems to hit the same > address, 0x6aab7c, belonging to the same symbol, _Py_ZeroStruct. > > This is what happens: > > (gdb) watch *0x6aab7c > Hardware watchpoint 1: *0x6aab7c >

[issue25720] Fix curses module compilation with ncurses6

2017-11-01 Thread Roundup Robot
Change by Roundup Robot : -- pull_requests: +4181 ___ Python tracker ___

  1   2   >