Re: syntax difference

2018-06-18 Thread Rhodri James
On 18/06/18 19:34, Jim Lee wrote: Type hints are just that - hints.  They have no syntactic meaning to the parser, This is plainly not true, otherwise the parser would be throwing syntax errors at you all the time. Whether they have semantic meaning to the parser is more debatable. --

Re: syntax difference

2018-06-18 Thread Bart
On 18/06/2018 15:03, Steven D'Aprano wrote: It is 2018. People who say that static typing cannot be integrated with dynamic languages are nearly half a century behind the state of the art in computer programming. It can be, but it spoils the language. In the case of Python, it is already so

Re: syntax difference

2018-06-18 Thread Chris Angelico
On Tue, Jun 19, 2018 at 6:03 AM, Bart wrote: > In the end I got rid of them to keep the language purer, smaller and > simpler. Other approaches which don't involve annotating source code (eg. > type inference) are better IMO. Inference is great when it works. How do you assist a type inference

[issue28710] Sphinx incompatible markup in the standard library docstrings

2018-06-18 Thread Raymond Hettinger
Raymond Hettinger added the comment: Marking this as closed. Though well-intentioned, the suggestion is predicated on a misperception of the role of Sphinx for CPython and existing PEP recommendations on docstring practices. -- nosy: +rhettinger resolution: -> not a bug stage:

Re: syntax difference

2018-06-18 Thread Rick Johnson
Chris Angelico wrote: [...] > assert """ > , ", ";print('Will I print?');\ > "';print("Or will I?");\ > ';print("What about me?");'''\ > print("And me? Where endeth");"""\ > print('the assertion?');\ Chris, that's not code... That's a syntactical representation of some random flea

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

2018-06-18 Thread Charalampos Stratakis
Charalampos Stratakis added the comment: I'd say there are use cases where gdb will be used with optimizations especially in downstream distribution. -- ___ Python tracker

[issue28710] Sphinx incompatible markup in the standard library docstrings

2018-06-18 Thread R. David Murray
R. David Murray added the comment: I would still like to see the legacy tex markup removed from the docstrings, so I think closing this issue is not appropriate, but it's not a big enough deal that I'll push for it if Raymond wants to keep it closed. --

[issue33897] Add a restart option to logging.basicConfig()

2018-06-18 Thread Raymond Hettinger
New submission from Raymond Hettinger : Once a logger or basicConfig() has been called, later calls to basicConfig() are silent ignored. The makes it very difficult to experiment with or teach the various options at the interactive prompt or in a Jupyter notebook. What we have: >>>

Re: syntax difference

2018-06-18 Thread Chris Angelico
On Tue, Jun 19, 2018 at 6:25 AM, Rick Johnson wrote: > Chris Angelico wrote: > [...] >> assert """ >> , ", ";print('Will I print?');\ >> "';print("Or will I?");\ >> ';print("What about me?");'''\ >> print("And me? Where endeth");"""\ >> print('the assertion?');\ > > Chris, that's not

[issue33896] filecmp.cmp returns True on files that differ

2018-06-18 Thread Dean Morin
New submission from Dean Morin : By default `filecmp.cmp()` has `shallow=True` which can produce some surprising behavior. In the docs it states: > If shallow is true, files with identical os.stat() signatures are taken to be > equal. However the "signature" only considers the file mode,

[issue33895] LoadLibraryExW called with GIL held can cause deadlock

2018-06-18 Thread Antoine Pitrou
Antoine Pitrou added the comment: Do you want to submit a PR for this? You can take a look at our developer's guide if you're new to contributing to Python: https://devguide.python.org/ -- nosy: +pitrou stage: -> needs patch type: -> behavior versions: -Python 2.7, Python 3.4,

Re: syntax difference

2018-06-18 Thread Jim Lee
On 06/18/2018 12:52 PM, Rhodri James wrote: On 18/06/18 19:34, Jim Lee wrote: Type hints are just that - hints.  They have no syntactic meaning to the parser, This is plainly not true, otherwise the parser would be throwing syntax errors at you all the time.  Whether they have semantic

[issue33896] filecmp.cmp returns True on files that differ

2018-06-18 Thread R. David Murray
R. David Murray added the comment: I understand your concern, but this is working as designed and documented. Using st_ino would mean you would return true if and only if it was the *same* file. That is not the intent. See issue 27396 for some background discussion. -- nosy:

Re: syntax difference

2018-06-18 Thread Ian Kelly
On Mon, Jun 18, 2018 at 11:27 AM Rick Johnson wrote: > > Ian wrote: > > > Uh, yes, they do. They're defined in PEP 484, and Mypy uses them for > > type-checking Python 2 code, where the annotations don't exist. > > So when will the interleaved type-hints be removed from the language >

Re: syntax difference

2018-06-18 Thread Rick Johnson
On Monday, June 18, 2018 at 12:46:36 PM UTC-5, Chris Angelico wrote: > What about assertions? Are they comments too? Should we > have, for instance: > > if x > 0: > ... > elif x < 0: > ... > else: > #assert: x == 0 > ... > > or is it better to use an 'assert' statement? After

Re: syntax difference

2018-06-18 Thread Rick Johnson
On Monday, June 18, 2018 at 1:02:18 PM UTC-5, Ian wrote: [...] > When PEP 3107 was written, it was anticipated that > annotations would find more uses than just type hinting. > Some of those proposed ideas (e.g. database query mapping) > depend on the annotation being readable at run-time, for >

[issue28710] Sphinx incompatible markup in the standard library docstrings

2018-06-18 Thread Terry J. Reedy
Terry J. Reedy added the comment: RestructuredText, DocUtils, and Sphinx were developed independently, by people other than the pydev/cpython group. (The proposal to include DocUtils in the stdlib was rejected.) We converted to .rst for the Python documentation sources files about a

Re: syntax difference

2018-06-18 Thread Rick Johnson
On Monday, June 18, 2018 at 1:50:09 PM UTC-5, Chris Angelico wrote: [...] > I don't know what you mean by "syntactic meaning". Do you mean that > they create no executable bytecode, that they have no run-time > influence? Because that's not entirely true; they are stored, and can > be viewed at

Re: syntax difference

2018-06-18 Thread Chris Angelico
On Tue, Jun 19, 2018 at 5:26 AM, Rick Johnson wrote: > On Monday, June 18, 2018 at 12:46:36 PM UTC-5, Chris Angelico wrote: > >> What about assertions? Are they comments too? Should we >> have, for instance: >> >> if x > 0: >> ... >> elif x < 0: >> ... >> else: >> #assert: x == 0 >>

Re: syntax difference

2018-06-18 Thread Ian Kelly
On Mon, Jun 18, 2018 at 10:19 AM Rick Johnson wrote: > And even from the POV of a programmer, comments can be more > useful if they are ignored than if they are not. Some > programmers lack the skill required to properly explain the > workings of an algorithm in natural language, and thus, the >

Re: syntax difference

2018-06-18 Thread Rhodri James
On 18/06/18 19:21, Jim Lee wrote: Thanks for the explanation, but it only reinforces my view.  The more entrenched this feature becomes, the more we will see annotation-based tools and, at some point, we will all be forced to used annotations in order to take advantage of the tools. So don't

[issue28710] Sphinx incompatible markup in the standard library docstrings

2018-06-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Oh, you are right. I didn't write much English TeX, and used other types of quotes. I'm sure that I seen `such quotation' in non-TeX files, but maybe my memory fools me. In any case using this writing here is likely an artifact of copying from a TeX

[issue33301] Add __contains__ to pathlib

2018-06-18 Thread Andrew Berger
Andrew Berger added the comment: I can make these changes. Would probably add a .exists method to PurePath, using the _normal_accessor.stats staticmethod, then call that in __contains__ -- nosy: +aberger5b ___ Python tracker

Re: syntax difference

2018-06-18 Thread Chris Angelico
On Tue, Jun 19, 2018 at 4:09 AM, Jim Lee wrote: > > > On 06/18/2018 10:46 AM, Chris Angelico wrote: >> >> On Tue, Jun 19, 2018 at 3:34 AM, Jim Lee wrote: >>> >>> >>> On 06/18/2018 07:03 AM, Steven D'Aprano wrote: As a human programmer, you surely perform your own ad hoc type checking

Re: syntax difference

2018-06-18 Thread Chris Angelico
On Tue, Jun 19, 2018 at 3:34 AM, Jim Lee wrote: > > > On 06/18/2018 07:03 AM, Steven D'Aprano wrote: >> >> As a human programmer, you surely perform your own ad hoc type checking >> when you write and debug code. > > Of course. And, I use linting tools and other forms of static type > checking.

[issue28710] Sphinx incompatible markup in the standard library docstrings

2018-06-18 Thread Patrick Lehmann
Patrick Lehmann added the comment: Having single quotes in docstrings is also ok for Sphinx documentation. Btw. ReStructured text (docutils) was invented to document Python sources, why is it not used by Python? -- ___ Python tracker

Re: syntax difference

2018-06-18 Thread Jim Lee
On 06/18/2018 11:01 AM, Ian Kelly wrote: On Mon, Jun 18, 2018 at 11:39 AM Jim Lee wrote: On 06/18/2018 07:03 AM, Steven D'Aprano wrote: As a human programmer, you surely perform your own ad hoc type checking when you write and debug code. Of course. And, I use linting tools and other

[issue33895] LoadLibraryExW called with GIL held can cause deadlock

2018-06-18 Thread Tony Roberts
Tony Roberts added the comment: Sure, I'll get that done in the next couple of days. -- ___ Python tracker ___ ___

Re: syntax difference

2018-06-18 Thread Jim Lee
On 06/18/2018 11:18 AM, Chris Angelico wrote: What, fundamentally, is the difference between type hints and assertions, such that - in your view - one gets syntax and the other is just comments? Type hints are just that - hints.  They have no syntactic meaning to the parser, and do not

Re: syntax difference

2018-06-18 Thread Jim Lee
On 06/18/2018 11:49 AM, Chris Angelico wrote: On Tue, Jun 19, 2018 at 4:34 AM, Jim Lee wrote: On 06/18/2018 11:18 AM, Chris Angelico wrote: What, fundamentally, is the difference between type hints and assertions, such that - in your view - one gets syntax and the other is just comments?

Re: syntax difference

2018-06-18 Thread Ian Kelly
On Mon, Jun 18, 2018 at 11:39 AM Jim Lee wrote: > On 06/18/2018 07:03 AM, Steven D'Aprano wrote: > > As a human programmer, you surely perform your own ad hoc type checking > > when you write and debug code. > Of course. And, I use linting tools and other forms of static type > checking. What I

Re: syntax difference

2018-06-18 Thread Jim Lee
On 06/18/2018 10:46 AM, Chris Angelico wrote: On Tue, Jun 19, 2018 at 3:34 AM, Jim Lee wrote: On 06/18/2018 07:03 AM, Steven D'Aprano wrote: As a human programmer, you surely perform your own ad hoc type checking when you write and debug code. Of course. And, I use linting tools and

Re: syntax difference

2018-06-18 Thread Chris Angelico
On Tue, Jun 19, 2018 at 4:34 AM, Jim Lee wrote: > > > On 06/18/2018 11:18 AM, Chris Angelico wrote: >> >> What, fundamentally, is the difference between type hints and assertions, >> such that - in >> your view - one gets syntax and the other is just comments? > > Type hints are just that -

[issue33896] filecmp.cmp returns True on files that differ

2018-06-18 Thread R. David Murray
R. David Murray added the comment: For your problem, just don't use the default shallow setting :) -- ___ Python tracker ___ ___

Re: syntax difference

2018-06-18 Thread Rick Johnson
On Monday, June 18, 2018 at 2:48:58 PM UTC-5, Ian wrote: > I would also note that none of this applies to type hinting > in any case. Type hints don't require the programmer to be > able to explain anything in natural language, nor are they > prone to becoming out-of-sync. > > Because if they do,

Re: syntax difference

2018-06-18 Thread Chris Angelico
On Tue, Jun 19, 2018 at 6:52 AM, Rick Johnson wrote: > On Monday, June 18, 2018 at 2:48:58 PM UTC-5, Ian wrote: >> I would also note that none of this applies to type hinting >> in any case. Type hints don't require the programmer to be >> able to explain anything in natural language, nor are

[issue28710] Sphinx incompatible markup in the standard library docstrings

2018-06-18 Thread Terry J. Reedy
Terry J. Reedy added the comment: I agree with David. I would like the ugly markup changed independent of how Sphinx treats it. I was thinking of changing the title to "Change obsolete tex markup in stdlib docstrings". The intent of `word' was for people to see balanced quotes, which in

[issue33663] Web.py wsgiserver3.py raises TypeError when CSS file is not found

2018-06-18 Thread Steve Dower
Steve Dower added the comment: New changeset b36b0a3765bcacb4dcdbf12060e9e99711855da8 by Steve Dower (ValeriyaSinevich) in branch 'master': bpo-33663: Convert content length to string before putting to header (GH-7754)

[issue33663] Web.py wsgiserver3.py raises TypeError when CSS file is not found

2018-06-18 Thread miss-islington
Change by miss-islington : -- pull_requests: +7387 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33663] Web.py wsgiserver3.py raises TypeError when CSS file is not found

2018-06-18 Thread miss-islington
Change by miss-islington : -- pull_requests: +7388 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33855] IDLE: Minimally test every non-startup module.

2018-06-18 Thread miss-islington
miss-islington added the comment: New changeset 740f1cb20a8ae6e7f6daa14f2e240664643ce757 by Miss Islington (bot) in branch '3.7': bpo-33855: More edits and new minimal tests for IDLE (GH-7761) https://github.com/python/cpython/commit/740f1cb20a8ae6e7f6daa14f2e240664643ce757 --

Re: Metasyntactic thingies

2018-06-18 Thread Rhodri James
On 17/06/18 10:09, Steven D'Aprano wrote: But what placeholder names do you use for functions, methods or other actions? As in, placeholder verbs rather than nouns? Aside from such boring ones as "do_work" and similar, the only placeholder verb I can think of is frobnicate. Does anyone else

[issue33876] doc Mention relevant pythonesque implementations

2018-06-18 Thread Andrés Delfino
Change by Andrés Delfino : -- title: doc Mention the MicroPython implementation in Introduction -> doc Mention relevant pythonesque implementations ___ Python tracker ___

Re: syntax difference

2018-06-18 Thread Steven D'Aprano
On Mon, 18 Jun 2018 06:35:40 +1000, Chris Angelico wrote: > On Mon, Jun 18, 2018 at 6:23 AM, Marko Rauhamaa > wrote: >> Jim Lee : >>> IMHO, trying to shoehorn static type checking on top of a dynamically >>> typed language shows that the wrong language was chosen for the job. >> >> I'm also

Re: Python list vs google group

2018-06-18 Thread Gene Heskett
On Friday 15 June 2018 23:52:12 Gregory Ewing wrote: > Jim Lee wrote: > > It was so long ago that I forgot some of the > > details, but it boiled down to the TWAIN driver pushing the SCSI bus > > out of spec. > > Clearly you didn't sacrifice enough goats! > >

Re: Flask failure

2018-06-18 Thread T Berger
On Friday, June 15, 2018 at 1:48:16 PM UTC-4, Elismar Luz wrote: > Address already in use! Hi Elismar, I'm new to Python and didn't understand your post when I first read it. Thanks, Tamara -- https://mail.python.org/mailman/listinfo/python-list

Re: syntax difference

2018-06-18 Thread Steven D'Aprano
On Mon, 18 Jun 2018 06:56:56 +1000, Chris Angelico wrote: > You talk about "risk it all by trying to take the whole cake" as if > annotations are a change. But if they were already around before you > first met the language, then they're just part of the language. You > might as well argue

Re: syntax difference

2018-06-18 Thread Chris Angelico
On Mon, Jun 18, 2018 at 9:50 PM, Steven D'Aprano wrote: > On Mon, 18 Jun 2018 06:35:40 +1000, Chris Angelico wrote: > >> On Mon, Jun 18, 2018 at 6:23 AM, Marko Rauhamaa >> wrote: >>> Jim Lee : IMHO, trying to shoehorn static type checking on top of a dynamically typed language shows

Re: Understanding memory location of Python variables

2018-06-18 Thread Daniel Montecillo
I am also wondering about this behavior. Thank you Chris A for providing the explanation. On Jun 16, 2018, at 5:45 PM, Chris Angelico mailto:ros...@gmail.com>> wrote: On Sun, Jun 17, 2018 at 2:38 AM, mailto:ip.b...@gmail.com>> wrote: Hi everyone, I'm intrigued by the output of the following

Re: syntax difference

2018-06-18 Thread Marko Rauhamaa
Jim Lee : > Really?  Wow.  I'd hate to live in your world!  Just because something > exists, it can't be challenged or questioned.  Got it! No need to get overly agitated just because someone says something preposterous. Marko -- https://mail.python.org/mailman/listinfo/python-list

[issue33895] LoadLibraryExW called with GIL held can cause deadlock

2018-06-18 Thread Tony Roberts
New submission from Tony Roberts : In dynload_win.c LoadLibraryExW is called with the GIL held. This can cause a deadlock in an uncommon case where the GIL also needs to be acquired when another thread is being detached. Both LoadLibrary and FreeLibrary acquire the Windows loader-lock. If

Re: syntax difference

2018-06-18 Thread Chris Angelico
On Mon, Jun 18, 2018 at 9:16 PM, Bart wrote: > On 18/06/2018 11:45, Chris Angelico wrote: >> >> On Mon, Jun 18, 2018 at 8:33 PM, Bart wrote: > > > >>> You're right in that neither task is that trivial. >>> >>> I can remove comments by writing a tokeniser which scans Python source >>> and >>>

[issue33832] doc Add "magic method" entry to Glossary

2018-06-18 Thread Andrés Delfino
Change by Andrés Delfino : -- title: Make "magic methods" a little more discoverable in the docs -> doc Add "magic method" entry to Glossary ___ Python tracker ___

Re: syntax difference

2018-06-18 Thread Steven D'Aprano
On Sun, 17 Jun 2018 11:10:55 -0700, Rick Johnson wrote: > Steven D'Aprano wrote: >> Bart Wrote: >> > So what's a Type Hint associated with in Python? >> Since it is a type *hint*, not a type *declaration*, the interpreter >> can and does ignore it. > > But yet, the _programmer_ cannot ignore it.

Re: syntax difference

2018-06-18 Thread Steven D'Aprano
On Sun, 17 Jun 2018 16:46:05 -0700, Rick Johnson wrote: > People like myself will outright refuse to maintain your code. Whew Dan, you dodged a bullet there. -- Steven D'Aprano "Ever since I learned about confirmation bias, I've been seeing it everywhere." -- Jon Ronson --

[issue33855] IDLE: Minimally test every non-startup module.

2018-06-18 Thread miss-islington
miss-islington added the comment: New changeset 684bc3d67797f2b5ca9368fe7ecc1c3093d7b694 by Miss Islington (bot) in branch '3.6': bpo-33855: More edits and new minimal tests for IDLE (GH-7761) https://github.com/python/cpython/commit/684bc3d67797f2b5ca9368fe7ecc1c3093d7b694 --

Re: syntax difference

2018-06-18 Thread Chris Angelico
On Mon, Jun 18, 2018 at 8:33 PM, Bart wrote: > On 18/06/2018 01:10, Chris Angelico wrote: >> >> On Mon, Jun 18, 2018 at 9:30 AM, Rick Johnson >> wrote: >>> >>> On Sunday, June 17, 2018 at 2:07:40 PM UTC-5, Jim Lee wrote: >>> IMHO, trying to shoehorn static type checking on top of a

[issue33865] [EASY] Missing code page aliases: "unknown encoding: 874"

2018-06-18 Thread Ronald Oussoren
Ronald Oussoren added the comment: I'm not convinced that adding code to search_function is the right solution for this. BTW. I'm also not sure yet why this error happens, does windows return a codepage number as the preferred encoding when the io module looks for one? If so, wouldn't it

[issue33892] doc Use gender neutral words

2018-06-18 Thread Andrés Delfino
Change by Andrés Delfino : -- pull_requests: +7383 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

ANN: Version 0.1.5 of sarge (a subprocess wrapper library) has been released.

2018-06-18 Thread Vinay Sajip via Python-announce-list
Version 0.1.5 of Sarge, a cross-platform library which wraps the subprocessmodule in the standard library, has been released. What changed?- - Fixed #37: Instead of an OSError with a "no such file or directory" message,  a ValueError is raised with a more informative "Command not

Re: Python list vs google group

2018-06-18 Thread Alister via Python-list
On Fri, 15 Jun 2018 09:32:05 -0700, T Berger wrote: > On Friday, June 15, 2018 at 11:55:59 AM UTC-4, Chris Angelico wrote: >> Perhaps quantity is not the important thing here. > > It is the important thing. I'm stuck with a problem and still waiting > for replies to my email. I've decided to

Re: Is it possible to call a class but without a new instance created?

2018-06-18 Thread Vincent Vande Vyvre
Le 18/06/18 à 06:48, Jach Fong a écrit : After looking into the \tkiniter\font.py source file, triggered by Jim's hint on my previous subject "Why an object changes its "address" between adjacent calls?", I get more confused. Below was quoted from the font.py: def

[issue33871] Possible integer overflow in iov_setup()

2018-06-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Pablo and Ned! Seems there is other bug on Mac OS, not related to integer overflow. I am working on it. -- priority: normal -> high ___ Python tracker

Re: Is it possible to call a class but without a new instance created?

2018-06-18 Thread Terry Reedy
On 6/18/2018 12:48 AM, Jach Fong wrote: After looking into the \tkiniter\font.py source file, triggered by Jim's hint on my previous subject "Why an object changes its "address" between adjacent calls?", I get more confused. Below was quoted from the font.py: def

[issue33892] doc Use gender neutral words

2018-06-18 Thread Andrés Delfino
Andrés Delfino added the comment: Yes, of course! -- title: doc Add a couple of "or she/her" -> doc Use gender neutral words ___ Python tracker ___

Re: syntax difference

2018-06-18 Thread Bart
On 18/06/2018 01:10, Chris Angelico wrote: On Mon, Jun 18, 2018 at 9:30 AM, Rick Johnson wrote: On Sunday, June 17, 2018 at 2:07:40 PM UTC-5, Jim Lee wrote: IMHO, trying to shoehorn static type checking on top of a dynamically typed language shows that the wrong language was chosen for the

[issue33893] Linux terminal shortcuts support in python shell

2018-06-18 Thread Steven D'Aprano
Steven D'Aprano added the comment: Terry asked: > I have a question about Linux consoles. [...] Does a Linux console retrieve > all 5 at once, as IDLE does? Not typically. Like the Windows console, Linux consoles are also line-oriented, and hitting up-arrow cycles through each line, one at

Re: syntax difference

2018-06-18 Thread Bart
On 18/06/2018 12:33, Chris Angelico wrote: On Mon, Jun 18, 2018 at 9:16 PM, Bart wrote: What will those look like? If copyright/licence comments have their own specific syntax, then they just become another token which has to be recognised. If they have specific syntax, they're not

ANN: Version 0.1.5 of sarge (a subprocess wrapper library) has been released.

2018-06-18 Thread Vinay Sajip via Python-list
Version 0.1.5 of Sarge, a cross-platform library which wraps the subprocessmodule in the standard library, has been released. What changed?- - Fixed #37: Instead of an OSError with a "no such file or directory" message,  a ValueError is raised with a more informative "Command not

Re: syntax difference

2018-06-18 Thread Marko Rauhamaa
Chris Angelico : > On Mon, Jun 18, 2018 at 9:50 PM, Steven D'Aprano > wrote: >> On Mon, 18 Jun 2018 06:35:40 +1000, Chris Angelico wrote: >> >>> On Mon, Jun 18, 2018 at 6:23 AM, Marko Rauhamaa >>> wrote: I'm also saddened by the type hinting initiative. When you try to be best for

[issue33894] tempfile.tempdir cannot be unset

2018-06-18 Thread Eric V. Smith
Eric V. Smith added the comment: "If tempdir is unset or None" means "If tempdir has not been assigned to, or if it has been assigned the value None". "Unset" doesn't mean "delete from the module". I agree the documentation wording could be improved. -- assignee: -> docs@python

Re: Is it possible to call a class but without a new instance created?

2018-06-18 Thread Terry Reedy
To answer the question of the title, which is a bit different from the question in the text, yes. type(None)() always returns the singleton None object. (And one can write a singleton class in Python also.) bool() always returns one of False or True. int() and str() may return either a new

Re: syntax difference

2018-06-18 Thread Bart
On 18/06/2018 11:45, Chris Angelico wrote: On Mon, Jun 18, 2018 at 8:33 PM, Bart wrote: You're right in that neither task is that trivial. I can remove comments by writing a tokeniser which scans Python source and re-outputs tokens one at a time. Such a tokeniser normally ignores comments.

Re: syntax difference

2018-06-18 Thread Ed Kellett
On 2018-06-18 13:18, Chris Angelico wrote: > 1) Parse the code, keeping all the non-essential parts as well as the > essential parts. > 2) Find the comments, or find the annotations > 3) If comments, figure out if they're the ones you want to remove. > 4) Reconstruct the file without the bits you

Re: Understanding memory location of Python variables

2018-06-18 Thread Jeremy Black
Also, I don't think you can rely on memory being allocated sequentially any more now that everyone has implemented some level of ASLR. https://en.wikipedia.org/wiki/Address_space_layout_randomization On Sat, Jun 16, 2018 at 12:22 PM Alister via Python-list < python-list@python.org> wrote: > On

[issue28710] Sphinx incompatible markup in the standard library docstrings

2018-06-18 Thread R. David Murray
R. David Murray added the comment: By the way, in case anyone is curious, I'm pretty sure that markup is left over from the days when tex/latex was what docs were *written* in. -- ___ Python tracker

Re: syntax difference

2018-06-18 Thread Rick Johnson
Bart wrote: [...] > For example, comments that start with #T# (and in my case, > that begin at the start of a line). Such would be a _breeze_ to parse out. And i would argue (given a sufficiently unique tag) that arbitrary white space would not be any more error prone, either. Thus, your "tagged

Re: syntax difference

2018-06-18 Thread Rick Johnson
Steven D'Aprano wrote: [...] > particular at DropBox, which is (I believe) funding a lot of Guido's time > on this, because they need it. And now we get to the truth! Guido's new puppet master is the sole reason why this fine community -- of once free-roaming *STALLIONS*-- is now corralled

Re: syntax difference

2018-06-18 Thread Rick Johnson
Steven D'Aprano wrote: > Moving the type-checking out of the core language into the > IDE or linter which can be used or not used according to > the desire of the programmer Except, what your poppycock commentary seems to glaze over is the fact that whilst a programmer can certainly decided to

Re: syntax difference

2018-06-18 Thread Rick Johnson
Ian wrote: > Uh, yes, they do. They're defined in PEP 484, and Mypy uses them for > type-checking Python 2 code, where the annotations don't exist. So when will the interleaved type-hints be removed from the language specification? -- https://mail.python.org/mailman/listinfo/python-list

[issue33661] urllib may leak sensitive HTTP headers to a third-party web site

2018-06-18 Thread Artem Smotrakov
Artem Smotrakov added the comment: If I am not missing something, section 6.4 of RFC 7231 doesn't explicitly discuss that all headers should be sent. I wish it did :) I think that an Authorization header for host A may make sense for host B if both A and B use the same database with user

Re: syntax difference

2018-06-18 Thread Gregory Ewing
Bart wrote: I can remove comments by writing a tokeniser which scans Python source and re-outputs tokens one at a time. Such a tokeniser normally ignores comments. What was being talked about wasn't removing *all* comments, but removing just the ones that contain type hints. But to remove

[issue33893] Linux terminal shortcuts support in python shell

2018-06-18 Thread R. David Murray
R. David Murray added the comment: zsh lets you edit multiline shell commands as a unit. If you up-arrow, you get all the lines of the block popped up, with the cursor on the last line. Further arrow keys will navigate within the multiline text block, with an up-arrow from the first line

RE: syntax difference (type hints)

2018-06-18 Thread Dan Strohl via Python-list
> -Original Message- > From: Python-list On > Behalf Of Schachner, Joseph > Sent: Monday, June 18, 2018 7:58 AM > To: Ed Kellett ; python-list@python.org > Subject: RE: syntax difference (type hints) > > EXTERNAL MAIL: python-list-bounces+d.strohl=f5@python.org > > Assuming that

Re: syntax difference

2018-06-18 Thread Ian Kelly
On Mon, Jun 18, 2018 at 9:17 AM Rick Johnson wrote: > > Chris Angelico wrote: > [...] > > What was the quote before that? > > > > > "Type-hint comments" would allow: > > > (3) and those who utterly *HATE* them, to write a simpl[e] > > > little function which will strip them from any and all >

Folk etymology, was Re: Python list vs google group

2018-06-18 Thread Peter Otten
Grant Edwards wrote: > On 2018-06-18, Joe Pfeiffer wrote: >> Peter Otten <__pete...@web.de> writes: >> >>> Gene Heskett wrote: >>> This biggest single thing wrong with any of those old scsi interfaces is the bus's 5 volt isolation diode, the designer speced a shotkey(sp) diode,

Re: syntax difference

2018-06-18 Thread Ed Kellett
are you someone's ironic 3rd-year art project signature.asc Description: OpenPGP digital signature -- https://mail.python.org/mailman/listinfo/python-list

Re: syntax difference (type hints)

2018-06-18 Thread Ian Kelly
FYI, Python type hints aren't "proposed"; they're already here. The function annotation syntax was added in 3.0, without any imposition of semantic meaning or requirements on it, and allowed to simmer for several years for third-party frameworks to find uses for. Python 3.5 added the typing module

Re: syntax difference (type hints)

2018-06-18 Thread Chris Angelico
On Tue, Jun 19, 2018 at 12:57 AM, Schachner, Joseph wrote: > Assuming that we want Python to remain a dynamically typed (but strongly > typed) language, I believe the proposed type hints are only necessary for > function definitions, where the caller really needs to know the types of >

[issue33894] tempfile.tempdir cannot be unset

2018-06-18 Thread Philip Rowlands
Philip Rowlands added the comment: How about - If tempdir is unset or None at any call to + If tempdir is None (the default) at any call to This avoids headaches over the meaning of "unset", and accurately reflects the code at: https://github.com/python/cpython/blob/3.6/Lib/tempfile.py#L289

[issue23660] Turtle left/right inverted when using different coordinates orientation

2018-06-18 Thread Carol Willing
Carol Willing added the comment: Reopened at the request of the original submitter. -- resolution: remind -> stage: resolved -> patch review status: closed -> open ___ Python tracker

[issue33866] Stop using OrderedDict in enum

2018-06-18 Thread INADA Naoki
New submission from INADA Naoki : New changeset e57f91a0f0d5700ec466c9dd0fd2d2b5323a5e76 by INADA Naoki in branch 'master': bpo-33866: enum: Stop using OrderedDict (GH-7698) https://github.com/python/cpython/commit/e57f91a0f0d5700ec466c9dd0fd2d2b5323a5e76 --

[issue28710] Sphinx incompatible markup in the standard library docstrings

2018-06-18 Thread R. David Murray
R. David Murray added the comment: No, it is (somewhat) unique to tex. If you write `word' tex would turn that into a pair of opposing quotes in the typeset document, as opposed to 'word' (the convention in regular text/emails/posts/etc) where you'd just see ascii quotes. tex would render

Re: syntax difference

2018-06-18 Thread Rick Johnson
On Monday, June 18, 2018 at 6:43:36 AM UTC-5, Steven D'Aprano wrote: > The programmer can ignore [type-hints], just as they can > ignore any other form of documentation. Type-hints, as implemented, break all the rules of conventional documentation. In any programming language i have ever seen,

Re: syntax difference

2018-06-18 Thread Rick Johnson
On Monday, June 18, 2018 at 6:57:27 AM UTC-5, Steven D'Aprano wrote: > I still think that Python has been going nowhere but downhill ever since > extended slicing was added in version 1.4. Apples to oranges! -- https://mail.python.org/mailman/listinfo/python-list

Re: syntax difference

2018-06-18 Thread Rick Johnson
Steven D'Aprano said: > Python is not only alive and well, but actually growing in > popularity according to (as far as I can see) all the well- > known measures of language popularity. Steven *ALSO* said: > "Ever since I learned about confirmation bias, I've been > seeing it everywhere." Hmm?

[issue28710] Sphinx incompatible markup in the standard library docstrings

2018-06-18 Thread Terry J. Reedy
Terry J. Reedy added the comment: > AFAIK `name' is common writing of quotes in English texts I don't remember ever seeing it before. It looks like a typo to me, and I am sure it will to most readers. I think it should be corrected as if it were a typo. --

Re: syntax difference

2018-06-18 Thread Rick Johnson
On Monday, June 18, 2018 at 5:45:28 AM UTC-5, Chris Angelico wrote: > So in both cases, you would probably end up with something > like 2to3. And there you have it! Just Like Python3000, the python devs have caused a major disruption by saddling us with the syntactic noise of type- hints.

Re: Python list vs google group

2018-06-18 Thread Joe Pfeiffer
Peter Otten <__pete...@web.de> writes: > Gene Heskett wrote: > >> This biggest single thing wrong with any of those old scsi interfaces is >> the bus's 5 volt isolation diode, the designer speced a shotkey(sp) >> diode, and some damned bean counter saw the price diff and changed it to > > Is this

Re: Python list vs google group

2018-06-18 Thread Grant Edwards
On 2018-06-18, Joe Pfeiffer wrote: > Peter Otten <__pete...@web.de> writes: > >> Gene Heskett wrote: >> >>> This biggest single thing wrong with any of those old scsi interfaces is >>> the bus's 5 volt isolation diode, the designer speced a shotkey(sp) >>> diode, and some damned bean counter saw

  1   2   >