[issue33474] Support immutability per-field in dataclasses

2018-05-12 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: -> eric.smith components: +Library (Lib) versions: +Python 3.8 -Python 3.7 ___ Python tracker

[issue16823] Python quits on running tkinter code with threads

2018-05-12 Thread Terry J. Reedy
Change by Terry J. Reedy : -- resolution: -> duplicate ___ Python tracker ___ ___

[issue6933] Threading issue with Tkinter Frame.insert

2018-05-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: I changes the import to theading instead of thread and the start line to threading.Thread(target=example) On 3.7 with tcl/tk 8.6 with thread support, I see the gui when mainloop is called in the thread, and then the >>> prompt

Re: seeking deeper (language theory) reason behind Python design choice

2018-05-12 Thread Chris Angelico
On Sun, May 13, 2018 at 2:31 PM, Python wrote: > On Wed, May 09, 2018 at 03:57:35PM +1000, Chris Angelico wrote: >> On Wed, May 9, 2018 at 3:44 PM, Steven D'Aprano >> > If all programmers were as awesome as you and never made typos, the world >> > would be a better place.

Re: seeking deeper (language theory) reason behind Python design choice

2018-05-12 Thread Python
On Wed, May 09, 2018 at 03:57:35PM +1000, Chris Angelico wrote: > On Wed, May 9, 2018 at 3:44 PM, Steven D'Aprano > > If all programmers were as awesome as you and never made typos, the world > > would be a better place. But we know from experience that even > > experienced C programmers can make

[issue33257] Race conditions in Tkinter with non-threaded Tcl

2018-05-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: I opened #33479 Document tkinter and threads, as a spinoff of both this issue and #11077, msg183774. -- ___ Python tracker

[issue33479] Document tkinter and threads

2018-05-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: The information about the compile option comes from Ivan Pozdeev, #33257. I meant to add somewhere that thread support became default only with tk 8.6. -- ___ Python tracker

[issue11077] Tkinter is not thread safe

2018-05-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: The information missing from this issue is that tcl and tk can be compiled without and with thread support, and that the latter became default in 8.6, which is included with recent 3.x versions. Hence the launch example, as posted on

[issue16823] Python quits on running tkinter code with threads

2018-05-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: In the message above, I asked "why this code runs in 3.x but eventually fails in 2.x?". The answer is almost certainly that I used 3.5 with tk 8.6 compiled *with* thread support and 2.7 with tk 8.5 compiled without thread support. Serhiy,

[issue33479] Document tkinter and threads

2018-05-12 Thread Terry J. Reedy
New submission from Terry J. Reedy : (Proposed patch below) Library Reference Chapter 25, Graphical User Interfaces with Tk, covers tinter, some of its subpackages, and IDLE. The introduction, https://docs.python.org/3/library/tk.html states "the internal module _tkinter

[issue33478] PEP 8 CapWords reference wrong?

2018-05-12 Thread Amit Saha
New submission from Amit Saha : PEP 8 suggests class names and type variable names to be in CapWords case. However: >>> import string >>> string.capwords('CapWord') 'Capword' Wondering if this this an oversight or am I misunderstanding something? -- assignee:

Re: seeking deeper (language theory) reason behind Python design choice

2018-05-12 Thread Python
On Wed, May 09, 2018 at 05:44:57AM +, Steven D'Aprano wrote: > > On Tue, May 08, 2018 at 12:45:29AM +, Steven D'Aprano wrote: > >> Currently, the real reason is that lambda expressions are limited to a > >> single expression as the body of the function, and binding operations > >> in

Re: seeking deeper (language theory) reason behind Python design choice

2018-05-12 Thread Python
On Sun, May 13, 2018 at 01:01:04PM +1000, Chris Angelico wrote: > That's fine. Your experience has been that it hasn't been a problem; > other people's experience has been the opposite. I have never > personally had to deal with bugs in C code where braces are omitted > and multiple lines

Re: seeking deeper (language theory) reason behind Python design choice

2018-05-12 Thread Python
Drat, missed the main point I wanted to address in my last post: On Tue, May 08, 2018 at 11:36:06PM -0600, Ian Kelly wrote: > > This example also is a case FOR allowing assignments to be > > expressions. If Python allowed them, you could rewrite this as: > > > >while not (flag =

Re: seeking deeper (language theory) reason behind Python design choice

2018-05-12 Thread Chris Angelico
On Sun, May 13, 2018 at 12:42 PM, Python wrote: > On Wed, May 09, 2018 at 12:46:07PM -0400, Dennis Lee Bieber wrote: >> On Tue, 8 May 2018 22:48:52 -0500, Python >> >if spam == arg: >> >> Mis-typing that as >> >> if spam = arg: >>

Re: seeking deeper (language theory) reason behind Python design choice

2018-05-12 Thread Python
On Tue, May 08, 2018 at 11:36:06PM -0600, Ian Kelly wrote: > On Tue, May 8, 2018 at 9:48 PM, Python wrote: > > I'll give you an example that is both a case where Python's design > > choices make creating a bug easier, AND a case where allowing > > assignments to be

Re: seeking deeper (language theory) reason behind Python design choice

2018-05-12 Thread Python
On Wed, May 09, 2018 at 03:09:18PM +1000, Chris Angelico wrote: > On Wed, May 9, 2018 at 1:48 PM, Python wrote: [much snippage...] > > flag = (spam == arg) > > That's not "side effects only". Yeah, I'll chalk that up to posting too late in the evening after working

[issue30928] Copy modified blurbs to idlelib/NEWS.txt for 3.7.0

2018-05-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: I was looking for a way to link to a message in the context of an issue rather that on a page by itself. Neither worked. -- ___ Python tracker

[issue30928] Copy modified blurbs to idlelib/NEWS.txt for 3.7.0

2018-05-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: Testing undocumented issue.message reference I remember seeing somewhere: #11077.msg183774, #11077.183774 -- ___ Python tracker

[issue33470] Changes from GH-1638 (GH-3575, bpo-28411) are not documented in Porting to Python 3.7

2018-05-12 Thread Miro Hrončok
Miro Hrončok added the comment: The change is a bit beyond my understanding ATM. I might be able to study it and stitch something up, but I'd rather leave it to the author of the change. -- ___ Python tracker

[issue33471] string format with 'n' failling with french locales

2018-05-12 Thread Eric V. Smith
Eric V. Smith added the comment: After locale.setlocale(locale.LC_ALL, ''), what does local.localeconv() return? -- nosy: +eric.smith ___ Python tracker

[issue33453] from __future__ import annotations breaks dataclasses ClassVar and InitVar handling

2018-05-12 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- nosy: +levkivskyi ___ Python tracker ___ ___

[issue33477] Document that compile(code, 'exec') has different behavior in 3.7+

2018-05-12 Thread Matthias Bussonnier
New submission from Matthias Bussonnier : In recent Python the following >>> from ast import PyCF_ONLY_AST >>> compile("'a'", 'whatever', 'exec', PyCF_ONLY_AST).body In 3.6 it return [<_ast.Expr at 0x10b7441d0>] # that contail Str('a') While on master:

[issue33476] String index out of range in get_group(), email/_header_value_parser.py

2018-05-12 Thread Enrique Perez-Terron
New submission from Enrique Perez-Terron : When address group is missing final ';', 'value' will be an empty string. I suggest the following patch $ diff -u _save_header_value_parser.py _header_value_parser.py --- _save_header_value_parser.py2018-03-14

[issue33475] Fix converting AST expression to string and optimize parenthesis

2018-05-12 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- nosy: +gvanrossum ___ Python tracker ___ ___

[issue33475] Fix converting AST expression to string and optimize parenthesis

2018-05-12 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +6462 stage: -> patch review ___ Python tracker ___

[issue33475] Fix converting AST expression to string and optimize parenthesis

2018-05-12 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : The proposed patch fixes bugs in ast_unparse.c, makes it generating cleaner string representation, and makes the code cleaner. Known fixed bugs: 1. Extended slices crash Python. "s[a, b:c]". 2. 1-tuples produce illegal

[issue33474] Support immutability per-field in dataclasses

2018-05-12 Thread Daniel Lindeman
New submission from Daniel Lindeman : Currently, all fields in dataclasses can be frozen by passing frozen=True to the decorator. There are cases where it would be useful to have some fields be mutable, and others immutable. By using a strategy similar to how the decorator

[issue33462] reversible dict

2018-05-12 Thread Michael Selik
Michael Selik added the comment: Right, a blend of the code from dictiterobject (https://github.com/python/cpython/blob/master/Objects/dictobject.c#L3309) and listreviterobject (https://github.com/python/cpython/blob/master/Objects/listobject.c#L3128). --

[issue33462] reversible dict

2018-05-12 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: Hi, I'm taking a look this issue, it look like a new type `PyDictRevIterKey_Type` needs to be defined with its associated methods. I will try to implement the modifications ; this is the first time i'm taking a dive in Python's internals

[issue4934] tp_del and tp_version_tag undocumented

2018-05-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: Both tp_del and tp_version_tag are for internal use. Besides, tp_del is obsolete as I mentioned above. So I'm going to close the issue. -- resolution: -> not a bug stage: -> resolved status: open -> closed

[issue4934] tp_del and tp_version_tag undocumented

2018-05-12 Thread Antoine Pitrou
Antoine Pitrou added the comment: The reason tp_del has remained undocumented is that it's now obsolete. You should use tp_finalize instead: https://docs.python.org/3/c-api/typeobj.html#c.PyTypeObject.tp_finalize tp_finalize is roughly the C equivalent of __del__ (tp_del was

[issue4934] tp_del and tp_version_tag undocumented

2018-05-12 Thread book book
book book added the comment: tp_del still undocumented. In my opinion, tp_del corresponds to the __del__() method of classes, because there are no other variable correspondes to it, but methods using for creating(tp_new) and initializing(tp_init) an object are not.

[issue33463] Can namedtuple._asdict return a regular dict instead of OrderedDict?

2018-05-12 Thread Michael Selik
Change by Michael Selik : -- keywords: +patch pull_requests: +6461 stage: -> patch review ___ Python tracker ___

[issue33463] Can namedtuple._asdict return a regular dict instead of OrderedDict?

2018-05-12 Thread Michael Selik
Michael Selik added the comment: Is this warning what you had in mind? https://github.com/python/cpython/pull/6772 -- ___ Python tracker

[issue33473] build system incorrectly handles CC, CFLAGS, LDFLAGS, and related.

2018-05-12 Thread Eitan Adler
New submission from Eitan Adler : There are a number of incorrect items in python's build system. Expected behavior: - CC is correctly report as the compiler, and without any additional options - CFLAGS is correctly reported for the required flags to the compiler -

[issue33472] build system incorrectly handles CC, CFLAGS, LDFLAGS, and related.

2018-05-12 Thread Eitan Adler (bad account)
Eitan Adler (bad account) added the comment: closing this as I created under a bad account and can't find a way to merge them. -- resolution: -> duplicate stage: -> resolved status: open -> closed ___ Python tracker

[issue33472] build system incorrectly handles CC, CFLAGS, LDFLAGS, and related.

2018-05-12 Thread Eitan Adler
New submission from Eitan Adler : There are a number of incorrect items in python's build system. Expected behavior: - CC is correctly report as the compiler, and without any additional options - CFLAGS is correctly reported for the required flags to the compiler -

Re: Meaning of abbreviated terms

2018-05-12 Thread Ross Wilson
The "plist" abbreviation goes back to at least 1958 as it was used in the Lisp implementation [0].  And it may even predate Lisp.  I'm very sure that what actually went into a plist has often changed over the years, but the name persists. Lisp also used "association lists" [1] which were a

Re: Suggestion for a "data" object syntax

2018-05-12 Thread Mikhail V
On Sat, May 12, 2018 at 5:38 PM, Ian Kelly wrote: > On Fri, May 11, 2018 at 5:26 PM, Mikhail V wrote: >> On Fri, May 11, 2018 at 9:12 AM, Ian Kelly wrote: >>> On Thu, May 10, 2018 at 6:34 PM, Mikhail V

[issue33470] Changes from GH-1638 (GH-3575, bpo-28411) are not documented in Porting to Python 3.7

2018-05-12 Thread STINNER Victor
STINNER Victor added the comment: Is it a release blocker? -- nosy: +ned.deily priority: normal -> release blocker ___ Python tracker

[issue33470] Changes from GH-1638 (GH-3575, bpo-28411) are not documented in Porting to Python 3.7

2018-05-12 Thread STINNER Victor
STINNER Victor added the comment: Miro: do you want to work on a pull request? -- ___ Python tracker ___

Re: Suggestion for a "data" object syntax

2018-05-12 Thread Ian Kelly
On Fri, May 11, 2018 at 5:26 PM, Mikhail V wrote: > On Fri, May 11, 2018 at 9:12 AM, Ian Kelly wrote: >> On Thu, May 10, 2018 at 6:34 PM, Mikhail V wrote: >>> Do you understand that basically any python code sent by e-mail

Re: Suggestion for a "data" object syntax

2018-05-12 Thread Mikhail V
On Sat, May 12, 2018 at 7:54 AM, Steven D'Aprano wrote: > On Sat, 12 May 2018 02:26:05 +0300, Mikhail V wrote: > >> it is just not a trivial task to find an optimal solution to this > > We already have an optimal solution to this. Yes. current syntax will

[issue23607] Inconsistency in datetime.utcfromtimestamp(Decimal)

2018-05-12 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- assignee: -> serhiy.storchaka priority: normal -> low versions: +Python 3.8 -Python 3.4, Python 3.5 ___ Python tracker

[issue33442] Python 3 doc sidebar dosnt follow page scrolling like 2.7 doc sidebar.

2018-05-12 Thread Ned Deily
Change by Ned Deily : -- nosy: +ezio.melotti, georg.brandl ___ Python tracker ___ ___

[issue33471] string format with 'n' failling with french locales

2018-05-12 Thread David Vasseur
New submission from David Vasseur : Python 3.6.5 (default, Apr 14 2018, 13:17:30) [GCC 7.3.1 20180406] on linux Type "help", "copyright", "credits" or "license" for more information. >>> print('{:n}'.format(int(12))) 12 <-- ok -- >>> import locale >>>

[issue33427] Dead link in "The Python Standard Library" page

2018-05-12 Thread Ned Deily
Ned Deily added the comment: Note that while the link in the docs should be updated, the old link should redirect properly. That change has been requested in https://github.com/pypa/warehouse/issues/3914 -- nosy: +ned.deily ___

Re: Leading 0's syntax error in datetime.date module (Python 3.6)

2018-05-12 Thread bartc
On 12/05/2018 05:29, Steven D'Aprano wrote: On Fri, 11 May 2018 16:56:09 +0100, bartc wrote: 0100, if not intended as octal, is an undetectable error in C and Python 2. How fortunate then that Python 2 is history (soon to be ancient history) and people can use Python 3 where that error of

[issue29209] Remove old-deprecated ElementTree features

2018-05-12 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- versions: +Python 3.8 -Python 3.7 ___ Python tracker ___

[issue29209] Remove old-deprecated ElementTree features

2018-05-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The following two patches will remove getchildren() and getiterator() (in 3.9) and xml.etree.cElementTree (in an unspecified future). -- Added file:

[issue29209] Remove old-deprecated ElementTree features

2018-05-12 Thread Serhiy Storchaka
Change by Serhiy Storchaka : Added file: https://bugs.python.org/file47585/etree_remove_deprecated_cElementTree.diff ___ Python tracker

[issue29209] Remove old-deprecated ElementTree features

2018-05-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 6769 removes the html parameter and the doctype() method. getchildren() and getiterator() emit now a DeprecationWarning instead of PendingDeprecationWarning and will be removed in 3.9. --

[issue29209] Remove old-deprecated ElementTree features

2018-05-12 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +6457 ___ Python tracker ___ ___

Re: Leading 0's syntax error in datetime.date module (Python 3.6)

2018-05-12 Thread Chris Angelico
On Sat, May 12, 2018 at 6:44 PM, Gregory Ewing wrote: > Chris Angelico wrote: >> >> Tack setuid onto "owner", setgid onto "group", and sticky >> onto "others"? Pretty arbitrary, and disrupts the fundamental meaning >> of each set. > > > Yes, it would be totally silly

Re: Leading 0's syntax error in datetime.date module (Python 3.6)

2018-05-12 Thread Gregory Ewing
Marko Rauhamaa wrote: I'm guessing using letters as digits felt awkward among computer people for a long time. I think you may be underestimating how much weirdness early computer programmers were willing to accept. If you think using letters as hex digits is awkward, you should check out what

Re: Leading 0's syntax error in datetime.date module (Python 3.6)

2018-05-12 Thread Gregory Ewing
Chris Angelico wrote: Tack setuid onto "owner", setgid onto "group", and sticky onto "others"? Pretty arbitrary, and disrupts the fundamental meaning of each set. Yes, it would be totally silly if e.g. the "ls" command were to regroup them that way when displaying the permission bits... oh,

[issue29209] Remove old-deprecated ElementTree features

2018-05-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: getchildren() and getiterator() have deprecation notes in their docstrings in lxml.etree. -- ___ Python tracker

Re: Leading 0's syntax error in datetime.date module (Python 3.6)

2018-05-12 Thread Gregory Ewing
Steven D'Aprano wrote: You had computers with 6, 9, or even 60 bits per byte, And some early machines were even weirder, e.g. the EDSAC with effectively 17-bit words and 35-bit longwords. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

[issue33470] Changes from GH-1638 (GH-3575, bpo-28411) are not documented in Porting to Python 3.7

2018-05-12 Thread Miro Hrončok
New submission from Miro Hrončok : Background: gdb fails to build with Python 3.7 as described in https://bugzilla.redhat.com/show_bug.cgi?id=1577396 This is due to _PyImport_FixupBuiltin changing it's API. I feel that _underscored functions are probably not guaranteed to not

[issue33469] RuntimeError after closing loop that used run_in_executor

2018-05-12 Thread Hrvoje Nikšić
New submission from Hrvoje Nikšić : Looking at a StackOverflow question[1], I was unable to find a way to correctly close an event loop that uses run_in_executor() for long-running tasks. The question author tried to implement the following scenario: 1. create some tasks

Re: Meaning of abbreviated terms

2018-05-12 Thread Bob Martin
in 793617 20180511 072806 Steven D'Aprano wrote: >On Fri, 11 May 2018 07:20:36 +, Bob Martin wrote: > >> in 793605 20180511 044309 T Berger wrote: >>>On Saturday, May 5, 2018 at 6:45:46 PM UTC-4, MRAB wrote: On 2018-05-05 17:57, T