Re: Old Man Yells At Cloud

2017-09-19 Thread Rick Johnson
On Tuesday, September 19, 2017 at 12:55:14 PM UTC-5, Chris Angelico wrote: > On Wed, Sep 20, 2017 at 3:44 AM, Stefan Ram wrote: > > Steve D'Aprano did *not* write > > [it was edited/abbreviated by me - S. R.]: > > |disadvantages: > > |0 - it

[issue31525] switch to sqlite3_prepare_v2

2017-09-19 Thread Benjamin Peterson
New submission from Benjamin Peterson: sqlite has had the sqlite3_prepare_v2 API for more than 10 years now. The sqlite module should switch to using it, which will let us delete some code for automatically recompiling statements. -- components: Extension Modules messages: 302581

Re: Old Man Yells At Cloud

2017-09-19 Thread Rick Johnson
On Tuesday, September 19, 2017 at 1:31:52 PM UTC-5, bartc wrote: [...] > Can't you get around all those with things like > sys.stdout.write? Yes. > If so, what was the point of having a discrete print > statement/function at all? I believe the original intent was to create a universal

[issue31524] mailbox._mboxMMDF.get_message throws away From envelope

2017-09-19 Thread R. David Murray
R. David Murray added the comment: It just needs to call set_unixfrom as well as set_from. I don't know why the MMDFMessage tracks it separately, but I'm sure the author had a reason that seemed good at the time :) -- ___ Python tracker

[issue31498] Default values for zero in time.strftime()

2017-09-19 Thread Denis Osipov
Denis Osipov added the comment: Thank you for your answers. It's what I want to know. It looks like I shouldn't try to fix (to break) something that works well enough. If nobody minds I'll close the issue with not a bug resolution. -- ___ Python

[issue31500] IDLE: Tiny font on HiDPI display

2017-09-19 Thread Terry J. Reedy
Terry J. Reedy added the comment: It appears that the cutoff of 1.2 in the patch is too low. Try raising it to 1.4 and you should see the dialog normal. -- ___ Python tracker

[issue31517] MainThread association logic is fragile

2017-09-19 Thread Tim Peters
Tim Peters added the comment: Is there a problem here? I haven't heard of anyone even wondering about this before. threading.py worries about Threads created _by_ threading.py, plus the magical (from its point of view) thread that first imports threading.py. Users mix in `_thread` threads,

Re: Old Man Yells At Cloud

2017-09-19 Thread Ethan Furman
On 09/19/2017 09:37 AM, justin walters wrote: On Tue, Sep 19, 2017 at 9:17 AM, Grant Edwards wrote: On 2017-09-19, Jan Erik =?utf-8?q?Mostr=C3=B6m?= wrote: And I'm amazed how often I see people trying to calculate change = sum handed

[issue31500] IDLE: Tiny font on HiDPI display

2017-09-19 Thread Terry J. Reedy
Terry J. Reedy added the comment: I mean ' if scaling >= 1.2:' in run.fix_scaling. It would also be interesting to instead replace the last line, "font['size'] = -size" with "font['size'] = 9" (or 8 or 10) and see how close the dialog is to what is was before. --

Re: [Tutor] beginning to code

2017-09-19 Thread INADA Naoki
> > >>> False > 1 > False > >>> dir > 1 > True > >>> isinstance < 100 > False > >>> "" >= 10 > True > >>> (1,) <= 500 > False > > And down the rabbit hole we go! > > Now, not only do we have magic that implicitly casts all > objects to booleans in

[issue31524] mailbox._mboxMMDF.get_message throws away From envelope

2017-09-19 Thread bpoaugust
bpoaugust added the comment: I believe that setting the file back to the start is probably the best solution. The message as provided by e.g. postfix will include the From header and the parser is able to deal with that successfully, so I'm not sure why the mbox reader removes it before

[issue31522] mailbox._mboxMMDF.get_message throws away From envelope

2017-09-19 Thread bpoaugust
bpoaugust added the comment: https://github.com/python/cpython/blob/master/Lib/mailbox.py#L778 The code here reads the first line, but fails to save it as the unixfrom line. Alternatively perhaps it should reset the file back to the start so the message factory has sight of the envelope. The

[issue31522] _mboxMMDF.get_string() fails to pass param to get_bytes()

2017-09-19 Thread bpoaugust
Changes by bpoaugust : -- title: mailbox._mboxMMDF.get_message throws away From envelope -> _mboxMMDF.get_string() fails to pass param to get_bytes() ___ Python tracker

[issue31524] mailbox._mboxMMDF.get_message throws away From envelope

2017-09-19 Thread bpoaugust
New submission from bpoaugust: https://github.com/python/cpython/blob/master/Lib/mailbox.py#L778 The code here reads the first line, but fails to save it as the unixfrom line. Alternatively perhaps it should reset the file back to the start so the message factory has sight of the envelope.

[issue31500] IDLE: Tiny font on HiDPI display

2017-09-19 Thread Cheryl Sabella
Cheryl Sabella added the comment: >>> import tkinter as tk >>> root = tk.Tk() >>> print(float(root.tk.call('tk', 'scaling'))) 1. -- ___ Python tracker

[issue31524] mailbox._mboxMMDF.get_message throws away From envelope

2017-09-19 Thread bpoaugust
bpoaugust added the comment: It is not saving the unix from line. #!/usr/bin/env python3 with open("test.mbox",'w') as f: f.write("From sender@invalid Thu Nov 17 00:49:30 2016\n") f.write("Subject: Test\n") f.write("\n") f.write("\n") import mailbox messages =

[issue31508] Running test_ttk_guionly logs "test_widgets.py:1562: UserWarning: Deprecated API of Treeview.selection() should be removed" warnings

2017-09-19 Thread Cheryl Sabella
Cheryl Sabella added the comment: Serhiy, In tkinter __init__.py, there's messages on trace_variable and other trace functions about adding a deprecation warning. I didn't know if you intended to make those changes as well. -- nosy: +csabella ___

[issue31516] current_thread() becomes "dummy" thread during shutdown

2017-09-19 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___

[issue31522] _mboxMMDF.get_string() fails to pass param to get_bytes()

2017-09-19 Thread bpoaugust
New submission from bpoaugust: See: https://github.com/python/cpython/blob/master/Lib/mailbox.py#L787 The code should be self.get_bytes(key, from_)).as_string(unixfrom=from_) -- components: email messages: 302564 nosy: barry, bpoaugust, r.david.murray priority: normal severity: normal

[issue31522] _mboxMMDF.get_string() fails to pass param to get_bytes()

2017-09-19 Thread bpoaugust
bpoaugust added the comment: Ignore msg302569 - that was supposed to be a new issue. -- ___ Python tracker ___

[issue31501] Operator precedence description for arithmetic operators

2017-09-19 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: New changeset e2593aa673c0347a74c4896a519e3b8cb7b55eb4 by Mariatta (Miss Islington (bot)) in branch '3.6': bpo-31501: Operator precedence description for arithmetic operators (GH-3633) (GH-3638)

[issue31500] IDLE: Tiny font on HiDPI display

2017-09-19 Thread Roundup Robot
Changes by Roundup Robot : -- pull_requests: +3654 ___ Python tracker ___

Re: String to Dictionary conversion in python

2017-09-19 Thread sohcahtoa82
On Thursday, September 14, 2017 at 11:01:46 PM UTC-7, santosh.y...@gmail.com wrote: > Hi, > > Can anyone help me in the below issue. > > I need to convert string to dictionary > > string = " 'msisdn': '7382432382', 'action': 'select', 'sessionId': '123', > 'recipient': '7382432382',

Re: Old Man Yells At Cloud

2017-09-19 Thread Steve D'Aprano
On Wed, 20 Sep 2017 04:31 am, bartc wrote: > On 19/09/2017 17:30, Steve D'Aprano wrote: [snip list of problems with print] > Can't you get around all those with things like sys.stdout.write? If you had kept reading, you would have seen that I wrote: Of course an experienced Python coder

Re: [Tutor] beginning to code

2017-09-19 Thread Steve D'Aprano
On Wed, 20 Sep 2017 03:22 am, Chris Angelico wrote: > On Wed, Sep 20, 2017 at 2:20 AM, Steve D'Aprano > wrote: >> I can only think of four operations which are plausibly universal: >> >> Identity: compare two operands for identity. In this case, the type of the >>

[issue31523] Windows build file fixes

2017-09-19 Thread Steve Dower
New submission from Steve Dower: This is basically a note to myself to go and fix these things when I have time (before 3.7a2): * split upload steps so we can fail on real failures * fail immediately if gpg2 step fails * purge and retry if download fails -- assignee: steve.dower

[issue31524] mailbox._mboxMMDF.get_message throws away From envelope

2017-09-19 Thread R. David Murray
R. David Murray added the comment: It looks like it is saving it (the set_from line). Do you have a test that proves otherwise? -- ___ Python tracker

[issue31500] IDLE: Tiny font on HiDPI display

2017-09-19 Thread Terry J. Reedy
Terry J. Reedy added the comment: New changeset d6e2f26f3f7c62a4ddbf668027d3ba27cb0e1eca by Terry Jan Reedy in branch 'master': bpo-31500: Removed fixed size of IDLE config dialog. (#3664) https://github.com/python/cpython/commit/d6e2f26f3f7c62a4ddbf668027d3ba27cb0e1eca --

[issue31500] IDLE: Tiny font on HiDPI display

2017-09-19 Thread Terry J. Reedy
Terry J. Reedy added the comment: New changeset 97be14996b247b853ead77fb255d7029e3cf3dc9 by Terry Jan Reedy (Miss Islington (bot)) in branch '3.6': [3.6] bpo-31500: Removed fixed size of IDLE config dialog. (GH-3664) (#3665)

Re: Old Man Yells At Cloud

2017-09-19 Thread Rick Johnson
On Tuesday, September 19, 2017 at 2:08:05 AM UTC-5, Steven D'Aprano wrote: > [...] > 5.6775 is a much more useful answer than Fraction(2271, 400). ("What's > that in real money?") Steven, you're not using floats for currency are you? Tsk tsk! Besides, if Python division returned a useless

[issue31523] Windows build file fixes

2017-09-19 Thread Steve Dower
Steve Dower added the comment: Also: * build releases to versioned subdirectories of Py_IntDir when it is set -- ___ Python tracker ___

[issue31500] IDLE: Tiny font on HiDPI display

2017-09-19 Thread Cheryl Sabella
Cheryl Sabella added the comment: configdialog looks better now, but the fonts are still huge. The configdialog is almost bigger than the shell when it opens. -- Added file: https://bugs.python.org/file47155/configkey_2.png ___ Python tracker

[issue30744] Local variable assignment is broken when combined with threads + tracing + closures

2017-09-19 Thread Nick Coghlan
Nick Coghlan added the comment: For write-backs: no, since the interpreter will still write those values back into the destination cell For locals display: no, since nothing changes for the handling of fast locals For closure display: yes as, by default, debuggers will now print the closure

[issue31515] Doc for os.makedirs is inconsistent with actual behaviour

2017-09-19 Thread Franck Pommereau
New submission from Franck Pommereau: Documentation of os.makedirs says "The default mode is 0777 (octal)" but when I use os.makedirs("foo"), the directory is created with permissions 0755. Documentation should be updated or default mode fixed. I've tested it only with Python 2.7.6 and 3.4.3

[issue31506] Improve the error message logic for object_new & object_init

2017-09-19 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- keywords: +patch pull_requests: +3643 stage: needs patch -> patch review ___ Python tracker

[issue13224] Change str(x) to return only the qualname for some types

2017-09-19 Thread Nick Coghlan
Nick Coghlan added the comment: That said, bringing over my overall comment from the PR review: I think the number of additional changes needed in the test suite and the standard library highlights the compatibility restoration busy-work risks of actually making this change: - while

[issue13224] Change str(x) to return only the qualname for some types

2017-09-19 Thread Vedran Čačić
Vedran Čačić added the comment: getname sounds good, but is in fact very confusing. In most cases, what you'd actually want, and end up writing, is getname(type(x)), but we can't make it the default since for classes we would actually like x.__name__ directly. It seems you say the same with

Re: [Tutor] beginning to code

2017-09-19 Thread Antoon Pardon
Op 19-09-17 om 09:40 schreef Chris Angelico: > On Tue, Sep 19, 2017 at 5:10 PM, Antoon Pardon wrote: > >> I don't find it really usefull. How useful is it that you can type >> if a: instead of if a != 0: ? I have yet to encounter a situation >> where I thought: Yes I want to

Re: [Tutor] beginning to code

2017-09-19 Thread Steven D'Aprano
On Tue, 19 Sep 2017 09:10:04 +0200, Antoon Pardon wrote: > Op 18-09-17 om 15:47 schreef Paul Moore: >> On 18 September 2017 at 14:30, Antoon Pardon >> wrote: >>> Well that you reduce an object to a boolean value is not obvious to >>> begin with. A TypeError because you are

Re: [Tutor] beginning to code

2017-09-19 Thread Chris Angelico
On Tue, Sep 19, 2017 at 5:10 PM, Antoon Pardon wrote: > Op 18-09-17 om 15:47 schreef Paul Moore: >> On 18 September 2017 at 14:30, Antoon Pardon wrote: >>> Well that you reduce an object to a boolean value is not obvious to >>> begin with. A TypeError

Re: [Tutor] beginning to code

2017-09-19 Thread Chris Angelico
On Tue, Sep 19, 2017 at 5:22 PM, Antoon Pardon wrote: > But the problem is that the following two pieces of code don't do > the same in Python. > > if x: pass > if x is True: pass > > Sometimes I need that second statement but I can be sure that > should I show a piece of

Re: Stdlib, what's in, what's out

2017-09-19 Thread Stefan Behnel
John Ladasky schrieb am 19.09.2017 um 08:54: > I have come to understand from your other posts that adding something to > the stdlib imposes significant constraints on the release schedules of > those modules. I can appreciate the hassle that might cause. Still, > now I wonder what I might be

[issue31515] Doc for os.makedirs is inconsistent with actual behaviour

2017-09-19 Thread Franck Pommereau
Franck Pommereau added the comment: Sorry for the noise, I just discovered in the doc for os.mkdir that UMASK is applied on the mode passed to the functions. So the behaviour is actually correct. -- resolution: -> not a bug stage: -> resolved status: open -> closed

Re: [Tutor] beginning to code

2017-09-19 Thread Antoon Pardon
Op 19-09-17 om 09:46 schreef Chris Angelico: > On Tue, Sep 19, 2017 at 5:22 PM, Antoon Pardon wrote: >> But the problem is that the following two pieces of code don't do >> the same in Python. >> >> if x: pass >> if x is True: pass >> > ... > > which would be better

Re: Old Man Yells At Cloud

2017-09-19 Thread Chris Angelico
On Tue, Sep 19, 2017 at 5:07 PM, Steven D'Aprano wrote: > On Tue, 19 Sep 2017 03:23:15 +, Dan Sommers wrote: > >> On Tue, 19 Sep 2017 01:56:29 +, Stefan Ram wrote: >> >>> Steve D'Aprano writes: >> It is true that

Re: [Tutor] beginning to code

2017-09-19 Thread Chris Angelico
On Tue, Sep 19, 2017 at 7:21 PM, Antoon Pardon wrote: > Op 19-09-17 om 09:46 schreef Chris Angelico: >> On Tue, Sep 19, 2017 at 5:22 PM, Antoon Pardon wrote: >>> But the problem is that the following two pieces of code don't do >>> the same in Python.

Re: Even Older Man Yells At Whippersnappers

2017-09-19 Thread Christopher Reimer
> On Sep 19, 2017, at 9:09 AM, justin walters > wrote: > > On Tue, Sep 19, 2017 at 8:59 AM, Grant Edwards > wrote: > >>> On 2017-09-19, Rhodri James wrote: On 19/09/17 16:00, Stefan Ram wrote: D'Arcy Cain

Re: Old Man Yells At Cloud

2017-09-19 Thread Chris Angelico
On Wed, Sep 20, 2017 at 4:59 AM, Stefan Ram wrote: > "Jan Erik =?utf-8?q?Mostr=C3=B6m?=" writes: >>And I'm amazed how often I see people trying to calculate >>change = sum handed over - cost >>and then trying to figure out what bills/coins should be

[issue31518] ftplib, urllib2, poplib, httplib, urllib2_localnet use ssl.PROTOCOL_TLSv1 unconditionally

2017-09-19 Thread Christian Heimes
Christian Heimes added the comment: PR 3660 and PR 3661 address most of the failing tests. The two failures in msg302531 are discussed in issue #31453. -- ___ Python tracker

Re: Even Older Man Yells at Whippersnappers

2017-09-19 Thread Gene Heskett
On Tuesday 19 September 2017 13:38:42 ROGER GRAYDON CHRISTMAN wrote: > I recall giving a quiz to my college students sometime back around > the late nineties which had a little bit of arithmetic involved in the > answer. It's been too long ago to still have the exact details, but I > remember a

Re: Old Man Yells At Cloud

2017-09-19 Thread bartc
On 19/09/2017 17:26, Larry Martell wrote: On Tue, Sep 19, 2017 at 10:30 AM, D'Arcy Cain wrote: On 09/19/2017 06:46 AM, Larry Martell wrote: True story - the other day I was in a store and my total was $10.12. I One time I was at a cash with three or four items

Re: Issues with pip installation on windows

2017-09-19 Thread Bill Deegan
try using: python -m pip Does that work? On Tue, Sep 19, 2017 at 12:47 PM, Joey Steward wrote: > -- Forwarded message -- > From: Joey Steward > Date: Mon, Sep 18, 2017 at 3:26 PM > Subject: Issues with pip installation on windows

[issue31453] Debian Sid/Buster: Cannot enable TLS 1.0/1.1 with PROTOCOL_TLS

2017-09-19 Thread Christian Heimes
Christian Heimes added the comment: PR 3662 undos Debian's patching of OpenSSL. I'm not keen to undo a security improvement. However Debian is breaking backwards compatibility. For Python 3.7 we could consider to disable TLS 1.0 and TLS 1.1 for PROTOCOL_TLS_SERVER and PROTOCOL_TLS_CLIENT.

Re: Even Older Man Yells At Whippersnappers

2017-09-19 Thread MRAB
On 2017-09-19 19:15, Christopher Reimer wrote: On Sep 19, 2017, at 9:09 AM, justin walters wrote: On Tue, Sep 19, 2017 at 8:59 AM, Grant Edwards wrote: On 2017-09-19, Rhodri James wrote: On 19/09/17 16:00, Stefan

[issue31518] ftplib, urllib2, poplib, httplib, urllib2_localnet use ssl.PROTOCOL_TLSv1 unconditionally

2017-09-19 Thread Christian Heimes
Changes by Christian Heimes : -- pull_requests: +3650 ___ Python tracker ___ ___

[issue31507] email.utils.parseaddr has no docstring

2017-09-19 Thread R. David Murray
R. David Murray added the comment: New changeset 9e7b9b21fe45f7d93eaf9382fedfa18247d0d2b2 by R. David Murray (Rohit Balasubramanian) in branch 'master': bpo-31507 Add docstring to parseaddr function in email.utils.parseaddr (gh-3647)

[issue31415] Add -X option to show import time

2017-09-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If this proposition be accepted I would want to see not only cumulated times, but also pure times, without time of nested imports. I guess this feature doesn't work correctly with threading. -- nosy: +serhiy.storchaka

Re: Issues with pip installation on windows

2017-09-19 Thread MRAB
On 2017-09-19 20:19, Bill Deegan wrote: try using: python -m pip Does that work? If you want to be more specific, you can use the Python launcher: py -3.6 -m pip On Tue, Sep 19, 2017 at 12:47 PM, Joey Steward wrote: -- Forwarded message -- From:

[issue26673] Tkinter error when opening IDLE configuration menu (Tcl/Tk 8.6)

2017-09-19 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: +3652 ___ Python tracker ___

[issue31518] ftplib, urllib2, poplib, httplib, urllib2_localnet use ssl.PROTOCOL_TLSv1 unconditionally

2017-09-19 Thread Matthias Klose
Matthias Klose added the comment: Christian, I assume you'd like to see a test which can be done at *runtime*, not *buildtime*. Assuming you have that openssl upstream patch available in your build dependency, would that help with the detection? If yes, I'll talk to Debian's and Ubuntu's

[issue31453] Debian Sid/Buster: Cannot enable TLS 1.0/1.1 with PROTOCOL_TLS

2017-09-19 Thread Christian Heimes
Changes by Christian Heimes : -- keywords: +patch pull_requests: +3651 stage: -> patch review ___ Python tracker ___

Re: Even Older Man Yells At Whippersnappers

2017-09-19 Thread MRAB
On 2017-09-19 17:46, Larry Martell wrote: On Tue, Sep 19, 2017 at 12:12 PM, Rhodri James wrote: Eh, my school never 'ad an electronics class, nor a computer neither. Made programming a bit tricky; we 'ad to write programs on a form and send 'em off to next county. None

[issue31500] IDLE: Tiny font on HiDPI display

2017-09-19 Thread Terry J. Reedy
Terry J. Reedy added the comment: Cheryl, what do you get with import tkinter as tk root = tk.Tk() print(float(root.tk.call('tk', 'scaling'))) If it is less than 1.2, then Serhiy's revised patch should leave config dialog as it should be. -- ___

[issue31500] IDLE: Tiny font on HiDPI display

2017-09-19 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- pull_requests: +3653 ___ Python tracker ___ ___

[issue31508] Running test_ttk_guionly logs "test_widgets.py:1562: UserWarning: Deprecated API of Treeview.selection() should be removed" warnings

2017-09-19 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- keywords: +patch pull_requests: +3644 stage: -> patch review ___ Python tracker ___

[issue31516] current_thread() becomes "dummy" thread during shutdown

2017-09-19 Thread Antoine Pitrou
Antoine Pitrou added the comment: The main thread being marked "stopped" at shutdown might be an obscure feature (as hinted in the comments for threading._shutdown()). However, current_thread() should definitely not return a separate DummyThread instance. --

Re: Old Man Yells At Cloud

2017-09-19 Thread Chris Angelico
On Tue, Sep 19, 2017 at 7:31 PM, Steven D'Aprano wrote: > On Tue, 19 Sep 2017 17:59:10 +1000, Chris Angelico wrote: > >> Aside from the backward compatibility concerns (which mean that this >> can't be done in a language that calls itself "Python"), I'm not

[issue31496] IDLE: test_configdialog failed

2017-09-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Updated patch for issue31500 fixes this issue. I guess the problem was with using fixed size for the dialog widget. It was too small and the part of the example was not visible. -- ___ Python tracker

Re: Old Man Yells At Cloud

2017-09-19 Thread bartc
On 19/09/2017 11:46, Larry Martell wrote: On Mon, Sep 18, 2017 at 11:23 PM, Dan Sommers wrote: How relevant is the "people use calculators to do arithmetic" argument today? Okay, so I'm old and cynical, but I know [young] people who don't (can't?) calculate a gratuity

Re: [Tutor] beginning to code

2017-09-19 Thread Steven D'Aprano
On Tue, 19 Sep 2017 09:22:21 +0200, Antoon Pardon wrote: > But the problem is that the following two pieces of code don't do the > same in Python. > > if x: pass > if x is True: pass > > Sometimes I need that second statement "Need" is a funny thing. If all you are doing is testing the

[issue31512] Add non-elevated symlink support for dev mode Windows 10

2017-09-19 Thread Vidar Fauske
Changes by Vidar Fauske : -- pull_requests: +3645 stage: -> patch review ___ Python tracker ___

Re: [Tutor] beginning to code

2017-09-19 Thread Antoon Pardon
Op 19-09-17 om 11:22 schreef Steven D'Aprano: > On Tue, 19 Sep 2017 09:10:04 +0200, Antoon Pardon wrote: > >> Op 18-09-17 om 15:47 schreef Paul Moore: >>> On 18 September 2017 at 14:30, Antoon Pardon >>> wrote: Well that you reduce an object to a boolean value is not

[issue31492] assertion failures in case a module has a bad __name__ attribute

2017-09-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 6db7033192cd537ca987a65971acb01206c3ba82 by Serhiy Storchaka (Oren Milman) in branch 'master': bpo-31492: Fix assertion failures in case of a module with a bad __name__ attribute. (#3620)

Re: [Tutor] beginning to code

2017-09-19 Thread Rustom Mody
On Tuesday, September 19, 2017 at 4:41:01 PM UTC+5:30, Antoon Pardon wrote: > Op 19-09-17 om 11:22 schreef Steven D'Aprano: > > Except for bools, where people freak out and are convinced the world will > > end if you just ask an object "are you true or false?". > > > > Perhaps just a *tiny*

Re: [Tutor] beginning to code

2017-09-19 Thread Chris Angelico
On Tue, Sep 19, 2017 at 7:34 PM, Steven D'Aprano wrote: > On Tue, 19 Sep 2017 17:46:32 +1000, Chris Angelico wrote: > > >> # Display booleans differently if x is True: >> ... display flag >> else: >> ... display number >> >> which would be better

[issue31482] random.seed() doesn't work with bytes and version=1

2017-09-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Raymond, why the fix is not backported to 3.6? -- status: closed -> open ___ Python tracker ___

[issue31516] current_thread() becomes "dummy" thread during shutdown

2017-09-19 Thread Antoine Pitrou
New submission from Antoine Pitrou: Attaching reproducer. During interpreter shutdown, threading.main_thread() gets marked "stopped" (while it's obviously still running), while threading.current_thread() returns a DummyThread instance with the same ident as the main thread. $ ./python

Re: Old Man Yells At Cloud

2017-09-19 Thread Frank Millman
"bartc" wrote in message news:EN6wB.770830$uh.63078@fx28.am4... On 19/09/2017 11:46, Larry Martell wrote: > > True story - the other day I was in a store and my total was $10.12. I > pulled out a $20, and the cashier (probably age 23 or so) immediately > entered $20 as the amount tendered.

Re: Old Man Yells At Cloud

2017-09-19 Thread Larry Martell
On Mon, Sep 18, 2017 at 11:23 PM, Dan Sommers wrote: > How relevant is the "people use calculators to do arithmetic" argument > today? Okay, so I'm old and cynical, but I know [young] people who > don't (can't?) calculate a gratuity without an app or a web page. I use a

[issue6986] _json crash on scanner/encoder initialization error

2017-09-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could you please add a comment for test_make_encoder Victor? Invalid arguments are passed to c_make_encoder, but it raises a TypeError not because wrong types of argument, but because the number of arguments is insufficient. At first glance it looks as an

[issue31315] assertion failure in imp.create_dynamic(), when spec.name is not a string

2017-09-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 9974e1bcf3d0cec9b38b39b39b7ec8a1ebd9ef54 by Serhiy Storchaka (Oren Milman) in branch 'master': bpo-31315: Fix an assertion failure in imp.create_dynamic(), when spec.name is not a string. (#3257)

[issue31315] assertion failure in imp.create_dynamic(), when spec.name is not a string

2017-09-19 Thread Roundup Robot
Changes by Roundup Robot : -- keywords: +patch pull_requests: +3646 ___ Python tracker ___

Re: Old Man Yells At Cloud

2017-09-19 Thread Steven D'Aprano
On Tue, 19 Sep 2017 17:59:10 +1000, Chris Angelico wrote: > Aside from the backward compatibility concerns (which mean that this > can't be done in a language that calls itself "Python"), I'm not seeing > any reason that a human-friendly language can't spend most of its time > working with

Re: [Tutor] beginning to code

2017-09-19 Thread Steven D'Aprano
On Tue, 19 Sep 2017 17:46:32 +1000, Chris Angelico wrote: > # Display booleans differently if x is True: > ... display flag > else: > ... display number > > which would be better represented with "if isinstance(x, bool):" Given that True is a singleton, it is redundant to write if

[issue31506] Improve the error message logic for object_new & object_init

2017-09-19 Thread Nick Coghlan
Nick Coghlan added the comment: I filed issue 31527 as a follow-up issue to see whether or not it might be possible to amend the way these custom errors are generated to benefit from the work that has gone into improving the error responses from PyArg_ParseTupleAndKeywords. --

Issues with python commands in windows powershell

2017-09-19 Thread Joey Steward
Hello, I've been having issues using basic python commands in windows powershell. I'm new to programming so just going off of online tutorials. Earlier I was unable to use pip to install Django (pip install Django), and came to this forum for help and someone was able to give me the correct

[issue31525] require sqlite3_prepare_v2

2017-09-19 Thread Benjamin Peterson
Benjamin Peterson added the comment: ermm, yes, I guess I was looking at an old version of the code. -- title: switch to sqlite3_prepare_v2 -> require sqlite3_prepare_v2 ___ Python tracker

[issue31527] Report details of excess arguments in object_new & object_init

2017-09-19 Thread Nick Coghlan
Nick Coghlan added the comment: Adding a dependency on issue 31506, as this shouldn't be tackled until those simpler amendments are resolved. -- dependencies: +Improve the error message logic for object_new & object_init ___ Python tracker

Re: Old Man Yells At Cloud

2017-09-19 Thread Chris Angelico
On Wed, Sep 20, 2017 at 2:55 PM, Pavol Lisy wrote: > BTW if python would only bring "from __cleverness__ import > print_function" how many people would accept your reasons and use it? > And how many would rewrite old code? > > How many people would say something like: "Oh it

[issue31525] switch to sqlite3_prepare_v2

2017-09-19 Thread Berker Peksag
Berker Peksag added the comment: We already use sqlite3_prepare_v2 if it's available: https://github.com/python/cpython/blob/master/Modules/_sqlite/util.h#L43 Do you want to use sqlite3_prepare_v2() unconditionally and drop support for older SQLite versions? -- nosy: +berker.peksag

[issue31506] Improve the error message logic for object_new & object_init

2017-09-19 Thread Nick Coghlan
Changes by Nick Coghlan : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue31506] Improve the error message logic for object_new & object_init

2017-09-19 Thread Nick Coghlan
Nick Coghlan added the comment: Reopening, as I was a little hasty with the merge button: the merged PR *also* changed the `__init__` error message to drop the method name, but I don't think that's what we want. I'm also wondering if we should change the up-call case to *always* report the

Re: Old Man Yells At Cloud

2017-09-19 Thread Pavol Lisy
On 9/19/17, Steve D'Aprano wrote: [...] > The point is, we all make the occasional silly error. Doesn't mean we should > cripple our functions and fill the language with special cases like the > print > statement to avoid such rare errors. If print had always been a

[issue31527] Report details of excess arguments in object_new & object_init

2017-09-19 Thread Nick Coghlan
New submission from Nick Coghlan: object_new and object_init currently use their own argument checking logic, and hence haven't benefited from the error reporting enhancements in PyArg_ParseTupleAndKeywords Compare: >>> str(1, 2, 3, 4, 5, x=1) Traceback (most recent call last): File "",

[issue31506] Improve the error message logic for object_new & object_init

2017-09-19 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset a6c0c0695614177c8b6e1840465375eefcfee586 by Nick Coghlan (Serhiy Storchaka) in branch 'master': bpo-31506: Improve the error message logic for object.__new__ and object.__init__. (GH-3650)

Re: Old Man Yells At Cloud

2017-09-19 Thread MRAB
On 2017-09-20 01:41, Stefan Ram wrote: Steve D'Aprano writes: A simple "autocorrect" in *what*? The interpreter? The editor? Both? I imagine something like this: When the editor gets the command to run the contents of the buffer as Python, it would then

[issue31525] require sqlite3_prepare_v2

2017-09-19 Thread Benjamin Peterson
Changes by Benjamin Peterson : -- keywords: +patch pull_requests: +3655 stage: -> patch review ___ Python tracker ___

[issue31517] MainThread association logic is fragile

2017-09-19 Thread Nick Coghlan
Nick Coghlan added the comment: One place where this came up recently is in working out precisely how a Python-level subinterpreter API will interact with the threading API: https://mail.python.org/pipermail/python-dev/2017-September/149566.html That said, I do agree with Tim that the status

Re: [RELEASE] Python 3.6.3rc1 and 3.7.0a1 are now available for testing and more

2017-09-19 Thread Paul Rubin
Ned Deily writes: > You can find Python 3.7.0a1 and more information here: > https://www.python.org/downloads/release/python-370a1/ This says: The next pre-release of Python 3.7 will be 3.6.0a2, currently scheduled for 2016-10-16. :) --

[issue31526] Allow setting timestamp in gzip-compressed tarfiles

2017-09-19 Thread Jack Lloyd
New submission from Jack Lloyd: Context: I have a script which checks out a software release (tagged git revision) and builds an archive to distribute to end users. One goal of this script is that the archive is reproducible, ie if the script is run twice (at different times, on different

  1   2   >