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

2018-05-10 Thread bartc
On 10/05/2018 09:09, Marko Rauhamaa wrote: bartc : On 09/05/2018 06:44, Steven D'Aprano wrote: But by the time 1.4 came around, Guido had settled on a clean separation between statements and expressions as part of Python's design. That separation has gradually weakened over

[issue33454] Mismatched C function signature in _xxsubinterpreters.channel_close()

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

[issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS

2018-05-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See also issue33454 about a real bug found thanks to these warnings. -- ___ Python tracker

[issue33444] Memory leak/high usage on copy in different thread

2018-05-10 Thread whitespacer
whitespacer added the comment: pitrou, thanks for great diagnosing program! You are right that there is no memory leak. We have investigated this issue a little bit more - it looks real reason for large memory consuming in the end is not fragmentation, just glibc doesn't

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

2018-05-10 Thread Skip Montanaro
> > This gave the following error: > > Syntax Error: invalid token: C:\Users\Virgil Stokes\Desktop\Important > Notes_Files\CheckProcessingDate_02.py, line 7, pos 17 > d0 = date(2018,02,01) > Note that this is a Python syntax error. It actually has nothing to do with the datetime module. In Python

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

2018-05-10 Thread Steven D'Aprano
On Thu, 10 May 2018 12:43:33 +0200, Virgil Stokes wrote: > Why does the datetime.date  module (both built-in and site-package) not > accept leading 0's? This has nothing to do with the datetime module. Syntax Error means it it prohibited by the language, not the module. In Python 2, leading

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

2018-05-10 Thread Rustom Mody
Marko wrote: > When typing in code (in various languages), I have a habit of typing > "..." at places that need to be implemented Quite a research area actually https://wiki.haskell.org/GHC/Typed_holes -- https://mail.python.org/mailman/listinfo/python-list

[issue33454] Mismatched C function signature in _xxsubinterpreters.channel_close()

2018-05-10 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : The C function that implements _xxsubinterpreters.channel_close() is defined with the signature PyObject *channel_close(PyObject *self, PyObject *args, PyObject *kwds) which corresponds the method convention METH_VARARGS

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

2018-05-10 Thread Virgil Stokes
Module info: Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 17:00:18) [MSC v.1900 64 bit (AMD64)] C:\Python36>pip show datetime Name: DateTime Version: 4.2 Summary: This package provides a DateTime data type, as known from Zope 2. Unless you need to communicate with Zope 2 APIs, you're

[issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS

2018-05-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The following PRs fix warnings in casts to PyCFunction for method conventions different from METH_NOARGS, METH_O and METH_VARARGS. PR 6748 does this for Argument Clinic generated code (all files except Tools/clinic/clinic.py are

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

2018-05-10 Thread Marko Rauhamaa
bartc : > I wondered what it meant, so I typed in: > >print (...) > > and it displayed: > >Ellipsis > > which wasn't very enlightening. It doesn't mean anything for Python. It's just a special singleton sentinel object that is stored in the predefined variable "Ellipsis"

[issue33450] unexpected EPROTOTYPE returned by sendto on MAC OSX

2018-05-10 Thread Ronald Oussoren
Ronald Oussoren added the comment: The second link contains an explanation of what's going on, and that this is unexpected behaviour of the macOS kernel. I'm not sure what we could do about this, the blog post explains that this error can happen when send(2) is called

[issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS

2018-05-10 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +6437 ___ Python tracker ___ ___

[issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS

2018-05-10 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +6436 ___ Python tracker ___ ___

[issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS

2018-05-10 Thread Charalampos Stratakis
Charalampos Stratakis added the comment: Is it possible/feasible to fix that for the 3.7 and 3.6 branches as well? -- ___ Python tracker

[issue32942] Regression: test_script_helper fails

2018-05-10 Thread Ethan Smith
Ethan Smith added the comment: For reference this is happening with a clean checkout and build of master for me, which seems like it shouldn't be the case... -- nosy: +Ethan Smith ___ Python tracker

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

2018-05-10 Thread D'Arcy Cain
On 2018-05-10 07:28 AM, Skip Montanaro wrote: > https://www.python.org/dev/peps/pep-3127/#removal-of-old-octal-syntax Funny stuff: Python could either: 1. silently do the wrong thing... 2. immediately disabuse him... 3. let him continue to think... Some people passionately believe

[issue26701] Documentation for int constructor mentions __int__ but not __trunc__

2018-05-10 Thread miss-islington
Change by miss-islington : -- pull_requests: +6438 ___ Python tracker ___

[issue26701] Documentation for int constructor mentions __int__ but not __trunc__

2018-05-10 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset df00f048250b9a07195b0e3b1c5c0161fdcc9db8 by Nick Coghlan (Serhiy Storchaka) in branch 'master': bpo-26701: Tweak the documentation for special methods in int(). (GH-6741)

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

2018-05-10 Thread Rick Teachey
Rick Teachey added the comment: > Is there any scenario where the following code would be useful... Perhaps if someone, in search of a speedup, were sort of rolling their own lighter-weight equivalent to the typing module (in order to avoid importing the full typing

[issue33455] test.test_posix.TestPosixSpawn::test_specify_environment fails with custom LD_LIBRARY_PATH

2018-05-10 Thread Miro Hrončok
New submission from Miro Hrončok : When we build Python in Fedora, we set LD_LIBRARY_PATH environment variable so the testsuite is run against the currently built Python. However a test added in ef347535f289baad22c0601e12a36b2dcd155c3a (test_specify_environment) spawns a

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

2018-05-10 Thread AK
On 2018-05-10 12:43, Virgil Stokes wrote: Module info: Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 17:00:18) [MSC v.1900 64 bit (AMD64)] [...] I tried first to use Python's built-in datetime module as follows: from datetime import date, timedelta  d0 = date(2018,02,01) This gave the

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

2018-05-10 Thread D'Arcy Cain
On 2018-05-10 07:39 AM, AK wrote: > Try (should work from both PY2 and PY3): > > d0 = date(2018,0o2,0o1) Bad advice. Those numbers are decimal, not octal, You should use "date(2018,2,1)" here. Works in PY2, PY3 and for my birthday, Sept 4. -- D'Arcy J.M. Cain Vybe Networks Inc.

[issue33449] Documentation for email.charset confusing about the location of constants

2018-05-10 Thread R. David Murray
R. David Murray added the comment: Can you provide an example of where this occurs in the docs? -- nosy: +r.david.murray ___ Python tracker

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

2018-05-10 Thread AK
On 2018-05-10 13:52, D'Arcy Cain wrote: On 2018-05-10 07:39 AM, AK wrote: Try (should work from both PY2 and PY3): d0 = date(2018,0o2,0o1) Bad advice. Those numbers are decimal, not octal, You should use "date(2018,2,1)" here. Works in PY2, PY3 and for my birthday, Sept 4. It was only

[issue26701] Documentation for int constructor mentions __int__ but not __trunc__

2018-05-10 Thread miss-islington
Change by miss-islington : -- pull_requests: +6439 ___ Python tracker ___

[issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS

2018-05-10 Thread pmpp
Change by pmpp : -- nosy: +pmpp ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue32216] Document PEP 557 Data Classes (dataclasses module)

2018-05-10 Thread Ned Deily
Ned Deily added the comment: We really need to get this done prior to 370rc1 coming up on 05-21. -- priority: deferred blocker -> release blocker ___ Python tracker

[issue32375] Compilation warnings in getpath.c with gcc on Ubuntu / -D_FORTIFY_SOURCE=2

2018-05-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Warnings are emitted when compile with gcc-5, gcc-6 and gcc-7, but not when compile with gcc-4.8 or gcc-8. Versions: gcc-4.8 (Ubuntu 4.8.5-4ubuntu8) 4.8.5 gcc-5 (Ubuntu 5.5.0-12ubuntu1) 5.5.0 20171010 gcc-6 (Ubuntu

[issue20171] Derby #2: Convert 115 sites to Argument Clinic in Modules/_cursesmodule.c

2018-05-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset b00854caa080cec613496d3a5e1b0891c9ff83e6 by Serhiy Storchaka in branch 'master': bpo-20171: Convert the _curses and _curses_panel modules to Argument Clinic. (GH-4251)

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

2018-05-10 Thread Eric V. Smith
Eric V. Smith added the comment: I see that https://github.com/python/typing/issues/508 is also referenced in https://github.com/python-attrs/attrs/issues/361, where it contributed to attrs using string inspection. -- ___

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

2018-05-10 Thread Eric V. Smith
Eric V. Smith added the comment: See also [2]_ for a brief discussion of forward references, which makes get_type_hints() undesirable in this case. > This is why attrs went with the fast way which covers most (but not all) > bases in this case. If the annotation is a

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

2018-05-10 Thread Marko Rauhamaa
bartc : > On 09/05/2018 06:44, Steven D'Aprano wrote: >> But by the time 1.4 came around, Guido had settled on a clean separation >> between statements and expressions as part of Python's design. >> >> That separation has gradually weakened over the years, > > Presumably it's

[issue33015] Fix function cast warning in thread_pthread.h

2018-05-10 Thread Siddhesh Poyarekar
Siddhesh Poyarekar added the comment: gcc8.1 throws this warning irrespective of the cast since converting function pointers may result in undefined behaviour unless it is cast back to its original type. -- ___ Python

[issue33419] Add functools.partialclass

2018-05-10 Thread Nick Coghlan
Nick Coghlan added the comment: Marking as closed/later to indicate that we're not going to pursue this in the near term, but it's not out of the question that we might accept a future proposal along these lines. -- resolution: -> later stage: patch review ->

[issue26701] Documentation for int constructor mentions __int__ but not __trunc__

2018-05-10 Thread miss-islington
miss-islington added the comment: New changeset 22df4187c3882c6ec67180902e1151e65b03aee0 by Miss Islington (bot) in branch '3.7': bpo-26701: Tweak the documentation for special methods in int(). (GH-6741)

[issue26701] Documentation for int constructor mentions __int__ but not __trunc__

2018-05-10 Thread miss-islington
miss-islington added the comment: New changeset 7488c79b600cd173b0ccea13adb567d078e7b835 by Miss Islington (bot) in branch '3.6': bpo-26701: Tweak the documentation for special methods in int(). (GH-6741)

[issue32962] test_gdb fails in debug build with `-mcet -fcf-protection -O0`

2018-05-10 Thread Marcel Plch
Change by Marcel Plch : -- keywords: +patch pull_requests: +6441 stage: -> patch review ___ Python tracker ___

[issue33456] site.py: by default, a virtual environment is *not* isolated from the system-level site-packages directories

2018-05-10 Thread Lukas Waymann
Change by Lukas Waymann : -- keywords: +patch pull_requests: +6442 stage: -> patch review ___ Python tracker ___

[issue33457] python-config ldflags, PEP 513 and explicit linking to libpython in python extensions

2018-05-10 Thread dimi
New submission from dimi : The python-config outputs ldflag for explicit linking to libpyhton, which is a good idea in many use cases. However, this is inconsistent with the PEP 513 recommendation for building manylinux1 python extensions

[issue33456] site.py: by default, a virtual environment is *not* isolated from the system-level site-packages directories

2018-05-10 Thread Lukas Waymann
New submission from Lukas Waymann : PEP 405 says this: > By default, a virtual environment is entirely isolated from the system-level > site-packages directories. > > If the pyvenv.cfg file also contains a key include-system-site-packages with > a value of true (not case

[issue33455] test.test_posix.TestPosixSpawn::test_specify_environment fails with custom LD_LIBRARY_PATH

2018-05-10 Thread Miro Hrončok
Change by Miro Hrončok : -- keywords: +patch pull_requests: +6440 stage: -> patch review ___ Python tracker ___

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

2018-05-10 Thread Rob Gaddi
On 05/10/2018 03:02 AM, bartc wrote: On 10/05/2018 09:09, Marko Rauhamaa wrote: bartc : When typing in code (in various languages), I have a habit of typing "..." at places that need to be implemented. For example: if count: ... else:

Re: Print Failure or success based on the value of the standalone tool

2018-05-10 Thread Rob Gaddi
On 05/10/2018 09:48 AM, Ganesh Pal wrote: I have to test a standalone tool from a python script and I am using os.system() to run the tool . I need to take decision based on the return value of the standalone tool . But since os.system merely throws the output value to STDOUT & returns the

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

2018-05-10 Thread MRAB
On 2018-05-10 18:03, Ian Kelly wrote: On Thu, May 10, 2018 at 10:36 AM, bartc wrote: What, 0O100 instead of 0100? Yeah that's a big improvement... Fortunately octal doesn't get used much. The PEP discusses this: """ Proposed syntaxes included things like arbitrary radix

How to use an API (xsd format) in Python?

2018-05-10 Thread richardchausse
I need to get some data from CME Group which provides a public API to download (xsd) What packages should I use in Python to access this data through this API. Thank you. -- https://mail.python.org/mailman/listinfo/python-list

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

2018-05-10 Thread bartc
On 10/05/2018 12:28, Skip Montanaro wrote: This gave the following error: Syntax Error: invalid token: C:\Users\Virgil Stokes\Desktop\Important Notes_Files\CheckProcessingDate_02.py, line 7, pos 17 d0 = date(2018,02,01) Note that this is a Python syntax error. It actually has nothing to do

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

2018-05-10 Thread Ian Kelly
On Thu, May 10, 2018 at 5:49 AM, D'Arcy Cain wrote: > On 2018-05-10 07:28 AM, Skip Montanaro wrote: >> https://www.python.org/dev/peps/pep-3127/#removal-of-old-octal-syntax > > Funny stuff: > > Python could either: > > 1. silently do the wrong thing... > 2.

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

2018-05-10 Thread Ian Kelly
On Thu, May 10, 2018 at 10:36 AM, bartc wrote: > What, 0O100 instead of 0100? Yeah that's a big improvement... > > Fortunately octal doesn't get used much. The PEP discusses this: """ Proposed syntaxes included things like arbitrary radix prefixes, such as 16r100 (256 in

[issue33413] asyncio.gather should not use special Future

2018-05-10 Thread Martin Teichmann
Martin Teichmann added the comment: I looked a bit into the details, and found that bpo-30048 created the described weird behavior. There they fixed the problem that a cancel is ignored if a coroutine manages to cancel its own task and return immediately. As shown

Re: How to use an API (xsd format) in Python?

2018-05-10 Thread Chris Angelico
On Fri, May 11, 2018 at 3:49 AM, wrote: > I need to get some data from CME Group which provides a public API to > download (xsd) > What packages should I use in Python to access this data through this API. > Thank you. Depends a lot on the API, and I have no idea

Print Failure or success based on the value of the standalone tool

2018-05-10 Thread Ganesh Pal
I have to test a standalone tool from a python script and I am using os.system() to run the tool . I need to take decision based on the return value of the standalone tool . But since os.system merely throws the output value to STDOUT & returns the exit status (0 => no error) of the shell , how

[issue33448] Output_Typo_Error

2018-05-10 Thread Mark Dickinson
Mark Dickinson added the comment: Marking as pending; we can't take this forward without more input from the OP. As far as I can tell, the documentation is perfectly correct here: I suspect that there was a misunderstanding somewhere along the line. -- assignee:

Is this a bug or a feature in TkInter?

2018-05-10 Thread charmingoldgit
I'm learning to use TkInter in Python and came across this example program from 'Thinking in TkInter' (http://thinkingtkinter.sourceforge.net) - see below. Two buttons 'button1' and 'button2' are defined. The bug is that event.widget returns '.!frame.!button' from a button1 event. i.e. it

[issue28556] typing.py upgrades

2018-05-10 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- pull_requests: +6445 ___ Python tracker ___ ___

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

2018-05-10 Thread Chris Angelico
On Fri, May 11, 2018 at 4:31 AM, bartc wrote: > 2x100 (4) Binary > 3x100 (9) Ternary > 4x100 (16) Quaternary > 5x100 (25) etc > 6x100 (36) > 7x100 (49) > 8x100 (64) Octal > 9x100 (81) > ... (Not implemented 11x to 15x, nor 10x or 16x) >

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

2018-05-10 Thread Jon Ribbens
On 2018-05-10, Skip Montanaro wrote: >> I wonder why someone would take a feature generally agreed to be a >> poorly designed feature of C, and incorporate it into a new language. > > I think you might be looking at a decision made in the late 1980s through a > pair of

[issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS

2018-05-10 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +6444 ___ Python tracker ___ ___

[issue33413] asyncio.gather should not use special Future

2018-05-10 Thread Ned Deily
Change by Ned Deily : -- components: +asyncio nosy: +asvetlov, yselivanov ___ Python tracker ___

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

2018-05-10 Thread Skip Montanaro
> I wonder why someone would take a feature generally agreed to be a > poorly designed feature of C, and incorporate it into a new language. I think you might be looking at a decision made in the late 1980s through a pair of glasses made in 2018. As a C programmer back then I never had a problem

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

2018-05-10 Thread bartc
On 10/05/2018 18:03, Ian Kelly wrote: On Thu, May 10, 2018 at 10:36 AM, bartc wrote: What, 0O100 instead of 0100? Yeah that's a big improvement... Fortunately octal doesn't get used much. The PEP discusses this: """ Proposed syntaxes included things like arbitrary radix

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

2018-05-10 Thread Mikhail V
On Wed, May 9, 2018 at 8:50 AM, Chris Angelico wrote: > On Wed, May 9, 2018 at 3:36 PM, Ian Kelly wrote: >> >> while True: >> if we_are_done(): >> break >> # do some stuff >> ... >> if error_occurred(): >> break >>

[issue28556] typing.py upgrades

2018-05-10 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- pull_requests: +6446 ___ Python tracker ___ ___

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

2018-05-10 Thread Skip Montanaro
> This whole thread is reminding me PHP 2, which would magically treat > the second parameter of ChMod() as octal, because clearly if weak > typing is good then *no* typing must be best of all! >ChMod($filename, 644); // second parameter is actually 420 base 10 I knew there was a reason I

[issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS

2018-05-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think it safer to silence this kind of warnings in 3.7 and 3.6. PR 6757 does this. -- ___ Python tracker

Re: How to use an API (xsd format) in Python?

2018-05-10 Thread richardchausse
On Thursday, May 10, 2018 at 1:54:11 PM UTC-4, Chris Angelico wrote: > > I need to get some data from CME Group which provides a public API to > > download (xsd) > > What packages should I use in Python to access this data through this API. > > Thank you. > > Depends a lot on the API, and I

Re: How to use an API (xsd format) in Python?

2018-05-10 Thread Mark Lawrence
On 10/05/18 19:10, richardchau...@gmail.com wrote: On Thursday, May 10, 2018 at 1:54:11 PM UTC-4, Chris Angelico wrote: I need to get some data from CME Group which provides a public API to download (xsd) What packages should I use in Python to access this data through this API. Thank you.

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

2018-05-10 Thread Chris Angelico
On Fri, May 11, 2018 at 5:04 AM, Jon Ribbens wrote: > On 2018-05-10, Skip Montanaro wrote: >>> I wonder why someone would take a feature generally agreed to be a >>> poorly designed feature of C, and incorporate it into a new language. >> >> I

Re: Is this a bug or a feature in TkInter?

2018-05-10 Thread Terry Reedy
On 5/10/2018 2:12 PM, charmingold...@gmail.com wrote: I'm learning to use TkInter in Python and came across this example program from 'Thinking in TkInter' (http://thinkingtkinter.sourceforge.net) - see below. Two buttons 'button1' and 'button2' are defined. The bug is that event.widget

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

2018-05-10 Thread Peter Pearson
On Wed, 09 May 2018 12:51:15 -0700, Paul Rubin wrote: > Dennis Lee Bieber writes: >> Yes, code reviews may catch such errors... and later, when the >> summary of errors is analyzed for suggestions on how to reduce them -- >> the odds are good that "assignment

[issue33449] Documentation for email.charset confusing about the location of constants

2018-05-10 Thread R. David Murray
R. David Murray added the comment: Ah, I see. Yes, those strings are actually hardcoded in the documentation source instead of being references. You are correct, they should be fixed. Note, however, that Charset is part of the legacy API and isn't actually used if

[issue31670] Associate .wasm with application/wasm

2018-05-10 Thread Brad Nelson
Brad Nelson added the comment: We have a provisional registration for application/wasm now with IANA: https://www.iana.org/assignments/provisional-standard-media-types/provisional-standard-media-types.xhtml This is also shipping in Firefox and Chrome. Would it be

[issue33460] ... used to indicate many different things in chapter 3, some are confusing

2018-05-10 Thread Lew Kurtz
New submission from Lew Kurtz : https://docs.python.org/3/tutorial/introduction.html uses ... to mean 5 or 6 different things. Since ... is continuation prompt, some of these other uses on that page are confusing - at least they were to this newbie. The most confusing are

[issue33459] Define "tuple display" in the docs

2018-05-10 Thread R. David Murray
R. David Murray added the comment: Nope, a tuple display is not equal to a parenthesized list. For example, in: x = 1, 2, 3 1, 2, 3 is a tuple display. The parenthesis are optional in that case (in the general case it is the comma that makes the tuple, not the

[issue33459] Define "tuple display" in the docs

2018-05-10 Thread Cheryl Sabella
Cheryl Sabella added the comment: Actually, 'tuple display' is in the index under 'display' and links to the last paragraph in 6.2.3. However, except for the index name, that paragraph doesn't use the phrase 'tuple display'. So it gives the definition without saying what

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

2018-05-10 Thread Chris Angelico
On Fri, May 11, 2018 at 8:43 AM, bartc wrote: > This is Wrong, and would have been just as obviously wrong in 1989. Having spent many years programming in C and working on Unix, I strongly disagree. This was *not* obviously wrong. It's easy to say "but look at the real world";

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

2018-05-10 Thread bartc
On 10/05/2018 18:58, Skip Montanaro wrote: I wonder why someone would take a feature generally agreed to be a poorly designed feature of C, and incorporate it into a new language. I think you might be looking at a decision made in the late 1980s through a pair of glasses made in 2018. As a C

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

2018-05-10 Thread Marko Rauhamaa
Chris Angelico : > On Fri, May 11, 2018 at 5:59 AM, Marko Rauhamaa wrote: >> Joking aside, to answer Chris's question, of course you can use a >> real condition with "while". However, you shouldn't force it or try >> to avoid "while True". It turns out "while

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

2018-05-10 Thread Marko Rauhamaa
Paul Rubin : > Marko Rauhamaa writes: >> It turns out "while True" is the most natural choice in about half of >> the while loops. > > Maybe the rest would be "repeat until" if Python had that? No. "Repeat until" is a relatively infrequent need.

[issue33459] Fix "tuple display" mention in Expressions

2018-05-10 Thread Andrés Delfino
Change by Andrés Delfino : -- keywords: +patch pull_requests: +6447 stage: -> patch review ___ Python tracker ___

[issue33459] Fix "tuple display" mention in Expressions

2018-05-10 Thread Andrés Delfino
New submission from Andrés Delfino : Expressions mentions "tuple displays" in 6.16 (Operator precedence). AFAIK, there ano "tuple displays". Expressions mentions list, dict, and set displays, and then talks about generator expressions. I guess "parenthesized expressions"

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

2018-05-10 Thread Chris Angelico
On Fri, May 11, 2018 at 8:49 AM, Marko Rauhamaa wrote: > def split_cmd(self, cmd): > args = [] > while True: > match = self.TERM_PTN.match(cmd) > if match is None: > return None, None >

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

2018-05-10 Thread Bob van der Poel
On Thu, May 10, 2018 at 6:36 PM, Gene Heskett wrote: > On Thursday 10 May 2018 20:55:58 bartc wrote: > > > On 11/05/2018 01:25, Marko Rauhamaa wrote: > > > Chris Angelico : > > >> Octal makes a lot of sense in the right contexts. > > > > > > I think octal

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

2018-05-10 Thread Raymond Hettinger
Change by Raymond Hettinger : -- versions: -Python 3.7 ___ Python tracker ___

[issue33462] reversible dict

2018-05-10 Thread Raymond Hettinger
Change by Raymond Hettinger : -- versions: +Python 3.8 ___ Python tracker ___

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

2018-05-10 Thread Ian Kelly
On Thu, May 10, 2018 at 9:21 PM, Steven D'Aprano wrote: > On Thu, 10 May 2018 11:03:54 -0600, Ian Kelly wrote about proposed > prefixes for octal: > >> Personally I would have preferred the "t". > > "t" for octal, hey? > > That would be annoying if we ever

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

2018-05-10 Thread Steven D'Aprano
On Fri, 11 May 2018 01:51:47 +0300, Marko Rauhamaa wrote: > Paul Rubin : > >> Marko Rauhamaa writes: >>> It turns out "while True" is the most natural choice in about half of >>> the while loops. >> >> Maybe the rest would be "repeat until" if Python

[issue33461] json.loads(encoding=) does not emit deprecation warning.

2018-05-10 Thread Matthias Bussonnier
Change by Matthias Bussonnier : -- keywords: +patch pull_requests: +6449 stage: -> patch review ___ Python tracker ___

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

2018-05-10 Thread Steven D'Aprano
On Thu, 10 May 2018 17:36:39 +0100, bartc wrote: > I wonder why someone would take a feature generally agreed to be a > poorly designed feature of C, and incorporate it into a new language. Because in 1991 or thereabouts, when Guido was designing the language for the first time, he thought it

Re: Print Failure or success based on the value of the standalone tool

2018-05-10 Thread Cameron Simpson
On 11May2018 06:53, Ganesh Pal wrote: On Thu, May 10, 2018, 22:31 Rob Gaddi By not using os.system, it's been superseded for reasons exactly like yours. https://docs.python.org/3/library/subprocess.html is your friend. Can someone please help me understand this better

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

2018-05-10 Thread Steven D'Aprano
On Fri, 11 May 2018 05:17:59 +, Steven D'Aprano wrote: > On Fri, 11 May 2018 03:29:57 +0300, Marko Rauhamaa wrote: [...] > To answer your question from a later post: > > In what way does "while True" in the general case pretend to be an > infinite loop? Oops, sorry, that was Ian

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

2018-05-10 Thread Ian Kelly
On Thu, May 10, 2018 at 7:10 PM, Chris Angelico wrote: > On Fri, May 11, 2018 at 10:29 AM, Marko Rauhamaa wrote: >> Chris Angelico : >> >>> But for the loop itself, you absolutely CAN write this more logically. >>> I'll take your second

[issue33462] reversible dict

2018-05-10 Thread Michael Selik
New submission from Michael Selik : Now that dicts are tracking insertion order, they can be made reversible via the built-in reversed, just like OrderedDict. -- messages: 316386 nosy: selik priority: normal severity: normal status: open title: reversible dict type:

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

2018-05-10 Thread Steven D'Aprano
On Thu, 10 May 2018 11:03:54 -0600, Ian Kelly wrote about proposed prefixes for octal: > Personally I would have preferred the "t". "t" for octal, hey? That would be annoying if we ever get trinary literals. n for binary t for octal i for trinary or should that be r for ternary? o for

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

2018-05-10 Thread Michael Selik
New submission from Michael Selik : Since the basic dict is now keeping insertion order, can we switch namedtuple._asdict to return a basic dict? Other than OrderedDict.move_to_end and the repr, I believe there is no compatibility issue. -- messages: 316387 nosy: selik

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

2018-05-10 Thread Steven D'Aprano
On Fri, 11 May 2018 03:29:57 +0300, Marko Rauhamaa wrote: >> Now do you understand what I mean about putting the condition into the >> loop header? > > Thanks, but no thanks. The "while True" idiom beats that one hands down. Why do you think it is better to lie to the reader and tell them they

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

2018-05-10 Thread Gene Heskett
On Thursday 10 May 2018 23:21:11 Steven D'Aprano wrote: > On Thu, 10 May 2018 11:03:54 -0600, Ian Kelly wrote about proposed > > prefixes for octal: > > Personally I would have preferred the "t". > > "t" for octal, hey? > > That would be annoying if we ever get trinary literals. > > n for binary

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

2018-05-10 Thread Chris Angelico
On Fri, May 11, 2018 at 11:36 AM, Gene Heskett wrote: > So other than the *nix chmod, and some similar stuff in > os9/nitros9/amigados, I have never had to deal with octal. I'm sure the > security people would be pleased if another bit could be expanded into > the

[issue29204] Add code deprecations in ElementTree

2018-05-10 Thread Matthias Bussonnier
Change by Matthias Bussonnier : -- pull_requests: +6450 ___ Python tracker ___

Re: Meaning of abbreviated terms

2018-05-10 Thread T Berger
On Saturday, May 5, 2018 at 6:45:46 PM UTC-4, MRAB wrote: > On 2018-05-05 17:57, T Berger wrote: > > What does the "p" in "plist" stand for? > > Is there a python glossary that spells out the meanings of abbreviated > > terms? > > > "plist" is "property list". It's listed in the Python

  1   2   >