[issue29384] Unused beos build scripts

2017-01-28 Thread Senthil Kumaran
Senthil Kumaran added the comment: @martin, the patch looks good to me. Please go ahead and commit this. -- nosy: +orsenthil ___ Python tracker ___

What are your opinions on .NET Core vs Python?

2017-01-28 Thread Juan C.
As you guys might know, .NET Core is up and running, promising a "cross-platform, unified, fast, lightweight, modern and open source experience" (source: .NET Core official site). What do you guys think about it? Do you think it will be able to compete with and overcome Python in the opensource

[issue29326] Blank lines in ._pth file are not ignored

2017-01-28 Thread Steve Dower
Steve Dower added the comment: I haven't had a chance to try the patch (underpth_blank_lines.diff) or apply it, but it looks right. If one of the other core devs gets to apply this before I do, feel free. Alexey, you don't need to sign a CLA for this fix, but if you're going to contribute

[issue29386] select.epoll.poll may behave differently if timeout = -1 vs timeout = None

2017-01-28 Thread Gabriel McManus
New submission from Gabriel McManus: The select module epoll.poll method takes a "timeout" parameter which is documented as having a default value of -1 [1]. If no timeout (or None) is passed to epoll.poll, then a value of -1 is passed to the epoll_wait system call. But if a timeout of -1 is

[issue23980] Documentation for format units starting with 'e' is inconsistent

2017-01-28 Thread Martin Panter
Martin Panter added the comment: The O! and O& units are in a similar situation. They just use a different font and descriptive name, rather than a specific type: ``O!`` (object) [*typeobject*, PyObject \*] ``O&`` (object) [*converter*, *anything*] Following this lead, you could write:

[issue29385] Sockets Crashes or Memory Corruption

2017-01-28 Thread Dhiraj
New submission from Dhiraj: When Python Server receives a string of '/xff' (5 or more) from a page after completing a handshake, the tab immediately crashes. There are variations of this string with other characters mixed in that also cause an immediate close of python server. To

[issue29310] Document typing.NamedTuple default argument syntax

2017-01-28 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks for the patch. It applies cleanly. The docs build just fine. The markup looks okay. The example runs correctly. Applied and marking as closed. -- resolution: -> fixed status: open -> closed ___

[issue29310] Document typing.NamedTuple default argument syntax

2017-01-28 Thread Roundup Robot
Roundup Robot added the comment: New changeset b33c3f26eefa by Raymond Hettinger in branch '3.6': Issue 29310: Document typing.NamedTuple default argument syntax https://hg.python.org/cpython/rev/b33c3f26eefa -- nosy: +python-dev ___ Python tracker

[issue29384] Unused beos build scripts

2017-01-28 Thread Martin Panter
New submission from Martin Panter: Modules/ld_so_beos and Modules/ar_beos are no longer used since Be OS support was dropped from the configure script for Python 3: https://hg.python.org/cpython/diff/a5e984eda45a/configure.in I propose to also remove the scripts. -- components: Build

[issue29310] Document typing.NamedTuple default argument syntax

2017-01-28 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger nosy: +rhettinger ___ Python tracker ___

Re: Is shutil.get_terminal_size useless?

2017-01-28 Thread Grant Edwards
On 2017-01-28, Marko Rauhamaa wrote: > (Although if I were to design an operating system, I don't know if I > would bother with controlling terminals, job control or chirping > modems.) I've been using serial ports on Unix for 35 years, and maintaining serial drivers for Linux

Re: How coding in Python is bad for you

2017-01-28 Thread pavlovevidence
On Monday, January 23, 2017 at 9:24:56 AM UTC-8, bream...@gmail.com wrote: > The article is here http://lenkaspace.net/index.php/blog/show/111 > > Kindest regards. > > Mark Lawrence. I remember the old days of Python when it was just Perl's little brother. Sometimes I feel moments of

[issue29310] Document typing.NamedTuple default argument syntax

2017-01-28 Thread Guido van Rossum
Guido van Rossum added the comment: Sorry, I'm still sick. You may have to find another core dev to help you. -- ___ Python tracker ___

[issue29381] Tutorial documentation contains undefined reference to #!

2017-01-28 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Is Mariatta responsible for reviewing Documentation submissions? No, she is a new core developer and this is a good issue for her to do the initial review and post any thoughts on the subject. We've all got to start somewhere. > If so, should I nosy

[issue3991] urllib.request.urlopen does not handle non-ASCII characters

2017-01-28 Thread Martin Panter
Martin Panter added the comment: I’m not really an expert on non-ASCII URLs / IRIs. Maybe it is obvious to other people that this is a good general implementation, but for me to thoroughly review it I would need time to research the relevant RFCs, other implementations, suitability for the

[issue29262] Provide a way to check for *real* typing.Union instances

2017-01-28 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Cross-posting the link to upstream work on this: https://github.com/python/typing/pull/377 -- ___ Python tracker ___

[issue20664] _findLib_crle and _get_soname broken on latest SunOS 5.11

2017-01-28 Thread Martin Panter
Martin Panter added the comment: There is an Open Indiana buildbot , that was passing test_ctypes (until the buildbot went offline a few weeks ago). Would it be possible to include a regression test case? Also, in

[issue23287] ctypes.util.find_library needlessly call crle on Solaris

2017-01-28 Thread Martin Panter
Martin Panter added the comment: Do you have an opinion of the proposal Shawn? Judging by John’s “[the constant] is what the system provides, though users may customize as needed”, it sounds like the patch is more than a bug fix. Will it also mean find_library() will no longer search

[issue29362] regrtest: don't fail immediately if a child does crash

2017-01-28 Thread Ammar Askar
Ammar Askar added the comment: This patch makes it so that when a child runner crashes during a multiprocess test run, it is treated similar to a keyboard interrupt. That is, the currently running tests will continue to run and immediately after it will print out a summary. I think the test

Re: Is shutil.get_terminal_size useless?

2017-01-28 Thread Marko Rauhamaa
Chris Angelico : > On Sun, Jan 29, 2017 at 7:04 AM, eryk sun wrote: >> Now let's get rid of the terminal via setsid: >> >>$ echo spam | >> > 2>&1 setsid python3 -c 'import os >> > fd = os.open("/dev/tty", os.O_RDONLY) >> >

Re: Is shutil.get_terminal_size useless?

2017-01-28 Thread Chris Angelico
On Sun, Jan 29, 2017 at 7:04 AM, eryk sun wrote: > Now let's get rid of the terminal via setsid: > >$ echo spam | > > 2>&1 setsid python3 -c 'import os > > fd = os.open("/dev/tty", os.O_RDONLY) > > print(os.get_terminal_size(fd))' | > > cat > Traceback

Re: Is shutil.get_terminal_size useless?

2017-01-28 Thread eryk sun
On Sat, Jan 28, 2017 at 5:58 PM, Chris Angelico wrote: > Processes in the middle of pipelines *do not have* terminals. No, in the following case stderr is a terminal: $ echo spam | > python3 -c 'import os > print(os.get_terminal_size(2))' | > cat

Re: Is Python SSL API thread-safe?

2017-01-28 Thread Grant Edwards
On 2017-01-22, Christian Heimes wrote: > OpenSSL and Python's ssl module are thread-safe. However IO is not > safe concerning reentrancy. You cannot safely share a SSLSocket > between threads without a mutex. Certain aspects of the TLS protocol > can cause interesting side

Re: Is shutil.get_terminal_size useless?

2017-01-28 Thread Marko Rauhamaa
Chris Angelico : > Background processes don't have terminal access. Whether it's a daemon > or something started as "commandname >/dev/null 2>/dev/null &" from bash, it doesn't have access to a terminal. A nitpick: a process running in the background or a process with no open

[issue23287] ctypes.util.find_library needlessly call crle on Solaris

2017-01-28 Thread Shawn
Shawn added the comment: Could we get someone to evaluate this please? -- nosy: +swalker ___ Python tracker ___

Re: Is shutil.get_terminal_size useless?

2017-01-28 Thread Chris Angelico
On Sun, Jan 29, 2017 at 3:15 AM, Steve D'Aprano wrote: > On Sat, 28 Jan 2017 10:50 pm, Chris Angelico wrote: > >> On Sat, Jan 28, 2017 at 9:49 PM, Steve D'Aprano >> wrote: >>> The terminal size doesn't change just because I'm piping output

Re: Is shutil.get_terminal_size useless?

2017-01-28 Thread Grant Edwards
On 2017-01-28, Steve D'Aprano wrote: > On Sat, 28 Jan 2017 10:50 pm, Chris Angelico wrote: > >> On Sat, Jan 28, 2017 at 9:49 PM, Steve D'Aprano >> wrote: >>> The terminal size doesn't change just because I'm piping output to >>> another

[issue29310] Document typing.NamedTuple default argument syntax

2017-01-28 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Thank you! Guido, I think this is ready to be merged. -- ___ Python tracker ___

[issue29310] Document typing.NamedTuple default argument syntax

2017-01-28 Thread Jelle Zijlstra
Jelle Zijlstra added the comment: Fixed the typo -- Added file: http://bugs.python.org/file46445/issue29310-3.patch ___ Python tracker ___

[issue29381] Tutorial documentation contains undefined reference to #!

2017-01-28 Thread Jim Fasarakis-Hilliard
Jim Fasarakis-Hilliard added the comment: Indeed, this does create an issue. The last sentence in the documentation actually specifies where the encoding comment can be but doesn't strictly specify it can be on the second line if and only if preceded by `#!`. I'm thinking the last sentence

Reviews of book on introductory Python (was: Need reviews for my book on introductory python)

2017-01-28 Thread Thomas 'PointedEars' Lahn
mm0fmf wrote: > […] Python, the name of the language, is a proper noun and should be > captialised. In the few pages I read, Python appears as "python" and > "Python", randomly losing the capital letter. Lacking capitalisation > would suggest to me that some or all words are consistently written

Re: Is shutil.get_terminal_size useless?

2017-01-28 Thread Michael Torrie
On 01/28/2017 09:15 AM, Steve D'Aprano wrote: > Then explain why os.get_terminal_size() returns the correct answer. Basically you were asking two different questions there. shutil.get_terminal_size always asks the question of size of the terminal that the standard output file handle is connected

[issue29381] Tutorial documentation contains undefined reference to #!

2017-01-28 Thread Marco Buttu
Marco Buttu added the comment: You wrote: "It is also possible to specify a different encoding for source files. In order to do this, you can use a special comment line that defines the source file encoding::". I think that is not true, because the line have to be the first line, or right

Re: Is shutil.get_terminal_size useless?

2017-01-28 Thread Michael Torrie
On 01/28/2017 09:15 AM, Steve D'Aprano wrote: > Then get_terminal_size() should raise, unless you explicitly ask for a > default size. Which it does if you call it on the standard out file handle, which is the default, and for most applications, the most useful. --

Re: Is shutil.get_terminal_size useless?

2017-01-28 Thread Michael Torrie
On 01/28/2017 09:03 AM, Michael Torrie wrote: > On 01/28/2017 04:00 AM, Steve D'Aprano wrote: >>> $ COLUMNS=123 python3 test_gts.py | cat >>> shutil: os.terminal_size(columns=123, lines=999) >>> os: os.terminal_size(columns=72, lines=48) > > Interesting. On my machine with Python 3.4, calling >

Re: Is shutil.get_terminal_size useless?

2017-01-28 Thread Steve D'Aprano
On Sat, 28 Jan 2017 10:50 pm, Chris Angelico wrote: > On Sat, Jan 28, 2017 at 9:49 PM, Steve D'Aprano > wrote: >> The terminal size doesn't change just because I'm piping output to >> another process. Using the terminal size as a proxy for "being piped" is >> sheer

[issue27200] make doctest in CPython has failures

2017-01-28 Thread Marco Buttu
Marco Buttu added the comment: In order for the patches to work for every Python version (see #msg284622 ), I added a new feature to the Sphinx doctest extension, called pyversion. Starting from Sphinx 1.6, it will be possible to specify the Python version in order for the example to be

Re: Is shutil.get_terminal_size useless?

2017-01-28 Thread Michael Torrie
On 01/28/2017 04:00 AM, Steve D'Aprano wrote: >> $ COLUMNS=123 python3 test_gts.py | cat >> shutil: os.terminal_size(columns=123, lines=999) >> os: os.terminal_size(columns=72, lines=48) Interesting. On my machine with Python 3.4, calling os.get_terminal_size() and piping the output results in

Re: Is shutil.get_terminal_size useless?

2017-01-28 Thread Grant Edwards
On 2017-01-28, Steve D'Aprano wrote: > Right: I want to know what the terminal window is sized to. What do you mean by "the terminal"? Do you mean the device to which the program's output is connected? Since output is what you have control over, and what's width you

Update to Python 3 Cheat Sheet

2017-01-28 Thread Laurent Pointal
Hi, I updated the cheat sheet on the aesthetic side. Parts bloc and their title are now more easily identified with colors (but its nice with B printing too). French and german versions have also been updated. See https://perso.limsi.fr/pointal/python:memento A+ L.Pointal. --

[issue28055] pyhash's siphash24 assumes alignment of the data pointer

2017-01-28 Thread Antoine Pitrou
Antoine Pitrou added the comment: I agree with Stefan and Serhiy. Unaligned memoryviews shouldn't trigger a copy when hashing. -- nosy: +pitrou ___ Python tracker

[issue29302] add contextlib.AsyncExitStack

2017-01-28 Thread Vedran Čačić
Vedran Čačić added the comment: An example from "real life": I recently needed this when implementing a demo of dining philosophers using asyncio (when the order of locks should depend on comparison of fork ids, not be static). Of course, it wasn't hard to implement it directly, but still, it

Re: GUI

2017-01-28 Thread Peter Otten
hany.amin.mishr...@gmail.com wrote: > hay , i am new in the coding world,i would like to understand how a python > program is communicating with GUI, for example, if i have a code that > require the user to enter a value ,then this code will do some > calculations and return a value to the user,

Re: Is shutil.get_terminal_size useless?

2017-01-28 Thread Peter Otten
Steve D'Aprano wrote: >> One potential advantage of shutil.get_terminal_size() is that you can >> affect it with an environment variable: >> >> $ python3 test_gts.py | cat >> shutil: os.terminal_size(columns=999, lines=999) >> os: os.terminal_size(columns=72, lines=48) >> >> $ COLUMNS=123 python3

Re: Is shutil.get_terminal_size useless?

2017-01-28 Thread eryk sun
On Sat, Jan 28, 2017 at 8:03 AM, Steve D'Aprano wrote: > print('shutil:', shutil.get_terminal_size(fallback=(999, 999))) > print('os:', os.get_terminal_size(0)) [snip] > But if I pipe the output to something else, the shutil version fails to > determine the correct

[issue29381] Tutorial documentation contains undefined reference to #!

2017-01-28 Thread Jim Fasarakis-Hilliard
Jim Fasarakis-Hilliard added the comment: Hi, Raymond. Is Mariatta responsible for reviewing Documentation submissions? If so, should I nosy Mariatta in any future documentation issues? -- ___ Python tracker

[issue10544] yield expression inside generator expression does nothing

2017-01-28 Thread Armin Rigo
Armin Rigo added the comment: Let's see if the discussion goes anywhere or if this issue remains in limbo for the next 7 years. In the meantime, if I may humbly make a suggestion: whether the final decision is to give SyntaxError or change the semantics, one or a few intermediate versions

Re: Is shutil.get_terminal_size useless?

2017-01-28 Thread Chris Angelico
On Sat, Jan 28, 2017 at 9:49 PM, Steve D'Aprano wrote: > The terminal size doesn't change just because I'm piping output to another > process. Using the terminal size as a proxy for "being piped" is sheer > insanity. In a sense, there _is no_ terminal size when you're

[issue10544] yield expression inside generator expression does nothing

2017-01-28 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: > How about fixing CPython to raise SyntaxWarning or even SyntaxError? I think it is better to just fix the issue, i.e. make comprehensions be equivalent to for-loops even if they contain `yield`. (In particular this will lead to [(yield i) for i in

[issue10544] yield expression inside generator expression does nothing

2017-01-28 Thread Armin Rigo
Armin Rigo added the comment: Just to add my comment to this 7-years-old never-resolved issue: in PyPy 3.5, which behaves like Python 3.x in this respect, I made the following constructions give a warning. def wrong_listcomp(): return [(yield 42) for i in j] def

Re: Is shutil.get_terminal_size useless?

2017-01-28 Thread Steve D'Aprano
On Sat, 28 Jan 2017 07:39 pm, Peter Otten wrote: > One potential advantage of shutil.get_terminal_size() is that you can > affect it with an environment variable: > > $ python3 test_gts.py | cat > shutil: os.terminal_size(columns=999, lines=999) > os: os.terminal_size(columns=72, lines=48) > >

Re: Is shutil.get_terminal_size useless?

2017-01-28 Thread Steve D'Aprano
On Sat, 28 Jan 2017 07:27 pm, Chris Angelico wrote: > On Sat, Jan 28, 2017 at 7:03 PM, Steve D'Aprano > wrote: >> But if I pipe the output to something else, the shutil version fails to >> determine the correct terminal size, and falls back on the default: >> >> >>

GUI

2017-01-28 Thread hany . amin . mishriky
hay , i am new in the coding world,i would like to understand how a python program is communicating with GUI, for example, if i have a code that require the user to enter a value ,then this code will do some calculations and return a value to the user, how to do that? --

[issue29310] Document typing.NamedTuple default argument syntax

2017-01-28 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: I have found one typo (see Rietveld), otherwise LGTM. -- ___ Python tracker ___

[issue29366] os.listdir has inconsistent behavior when run on a non-directory

2017-01-28 Thread Eryk Sun
Eryk Sun added the comment: Python has no specific use for ERROR_PATH_NOT_FOUND (3) and just maps it to FileNotFoundError -- like the CRT maps it to ENOENT. Even if we wanted listdir() to specially handle this error, given that it's implemented via FindFirstFile, there's nothing that can be

Re: Is shutil.get_terminal_size useless?

2017-01-28 Thread Peter Otten
Steve D'Aprano wrote: > shutil.get_terminal_size returns the wrong values when you pipe your > output to another process, even it you do so in a terminal. Consider this > script: > > > import os > import shutil > print('shutil:', shutil.get_terminal_size(fallback=(999, 999))) > print('os:',

Re: Is shutil.get_terminal_size useless?

2017-01-28 Thread Chris Angelico
On Sat, Jan 28, 2017 at 7:03 PM, Steve D'Aprano wrote: > But if I pipe the output to something else, the shutil version fails to > determine the correct terminal size, and falls back on the default: > > > [steve@ando ~]$ python3.5 test_gts.py | cat > shutil:

Is shutil.get_terminal_size useless?

2017-01-28 Thread Steve D'Aprano
shutil.get_terminal_size returns the wrong values when you pipe your output to another process, even it you do so in a terminal. Consider this script: import os import shutil print('shutil:', shutil.get_terminal_size(fallback=(999, 999))) print('os:', os.get_terminal_size(0)) That uses two

Re: Need reviews for my book on introductory python

2017-01-28 Thread mm0fmf
On 27/01/2017 21:36, MRAB wrote: On 2017-01-27 21:18, mm0fmf wrote: On 27/01/2017 20:17, bob gailer wrote: On 1/25/2017 9:25 PM, Sandeep Nagar wrote: Hi, A few month ago I wrote a book on introductory python based on my experinces while teaching python to Bachelor students of engineering. It