Re: [Python-Dev] PEP 471 -- os.scandir() function -- a better and faster directory iterator

2014-06-26 Thread Glenn Linderman
I'm generally +1, with opinions noted below on these two topics. On 6/26/2014 3:59 PM, Ben Hoyt wrote: Should there be a way to access the full path? -- Should ``DirEntry``'s have a way to get the full path without using ``os.path.join(path, entry.nam

Re: [Python-Dev] PEP 471 -- os.scandir() function -- a better and faster directory iterator

2014-06-29 Thread Glenn Linderman
On 6/29/2014 5:28 AM, Nick Coghlan wrote: There'd still be a slight window of discrepancy (since the filesystem state may change between reading the directory entry and making the lstat() call), but this could be effectively eliminated from the perspective of the Python code by making the result

Re: [Python-Dev] PEP 471 -- os.scandir() function -- a better and faster directory iterator

2014-06-30 Thread Glenn Linderman
On 6/30/2014 4:25 PM, Devin Jeanpierre wrote: On Mon, Jun 30, 2014 at 3:07 PM, Tim Delaney wrote: On 1 July 2014 03:05, Ben Hoyt wrote: So, here's my alternative proposal: add an "ensure_lstat" flag to scandir() itself, and don't have *any* methods on DirEntry, only attributes. ... Most im

Re: [Python-Dev] My summary of the scandir (PEP 471)

2014-07-01 Thread Glenn Linderman
On 7/1/2014 2:20 PM, Paul Moore wrote: Please, let's stick to a low-level wrapper round the OS API for the first iteration of this feature. Enhancements can be added later, when real-world usage has proved their value. I almost wrote this whole message this morning, but didn't have time. Than

Re: [Python-Dev] Exposing the Android platform existence to Python modules

2014-07-31 Thread Glenn Linderman
On 7/31/2014 5:59 PM, Shiz wrote: Hi folks, I’m working on porting CPython to the Android platform, and while making decent progress, I’m currently stuck at a higher-level issue than adding #ifdefs for __ANDROID__ to C extension modules. The idea is, not only CPython extension modules have so

Re: [Python-Dev] Surely "nullable" is a reasonable name?

2014-08-04 Thread Glenn Linderman
On 8/4/2014 12:35 AM, Stephen Hansen wrote: On Mon, Aug 4, 2014 at 12:12 AM, Larry Hastings > wrote: Several people have said they found the name "nullable" surprising, suggesting I use another name like "allow_none" or "noneable". I, in turn, find their

Re: [Python-Dev] sum(...) limitation

2014-08-10 Thread Glenn Linderman
On 8/10/2014 1:24 AM, Stephen J. Turnbull wrote: Actually ... if I were a fan of the "".join() idiom, I'd seriously propose 0.sum(numeric_iterable) as the RightThang{tm]. Then we could deprecate "".join(string_iterable) in favor of "".sum(string_iterable) (with the same efficient semantics). Act

Re: [Python-Dev] Bytes path support

2014-08-21 Thread Glenn Linderman
On 8/21/2014 3:42 PM, Paul Moore wrote: I wonder how badly a Unix system would break if you specified UTF16 as the system encoding...? Paul Does Unix even support UTF-16 as an encoding? I suppose, these days, it probably does, for reading contents of files created on Windows, etc. (Unicode wa

Re: [Python-Dev] Bytes path support

2014-08-21 Thread Glenn Linderman
On 8/21/2014 3:54 PM, Antoine Pitrou wrote: Le 21/08/2014 18:27, Cameron Simpson a écrit : As remarked, codes 0 (NUL) and 47 (ASCII slash code) _are_ special to UNIX filename bytes strings. So you admit that POSIX mandates that file paths are expressed in an ASCII-compatible encoding after a

Re: [Python-Dev] Bytes path support

2014-08-22 Thread Glenn Linderman
On 8/22/2014 8:51 AM, Oleg Broytman wrote: What encoding does have a text file (an HTML, to be precise) with text in utf-8, ads in cp1251 (ad blocks were included from different files) and comments in koi8-r? Well, I must admit the HTML was rather an exception, but having a text file with

Re: [Python-Dev] Bytes path support

2014-08-22 Thread Glenn Linderman
On 8/22/2014 9:52 AM, Oleg Broytman wrote: On Fri, Aug 22, 2014 at 09:37:13AM -0700, Glenn Linderman wrote: On 8/22/2014 8:51 AM, Oleg Broytman wrote: What encoding does have a text file (an HTML, to be precise) with text in utf-8, ads in cp1251 (ad blocks were included from different

Re: [Python-Dev] Bytes path support

2014-08-22 Thread Glenn Linderman
On 8/22/2014 11:50 AM, Oleg Broytman wrote: On Fri, Aug 22, 2014 at 10:09:21AM -0700, Glenn Linderman wrote: On 8/22/2014 9:52 AM, Oleg Broytman wrote: On Fri, Aug 22, 2014 at 09:37:13AM -0700, Glenn Linderman wrote: On 8/22/2014 8:51 AM, Oleg Broytman wrote: What encoding does have

Re: [Python-Dev] Bytes path support

2014-08-27 Thread Glenn Linderman
On 8/27/2014 5:16 AM, Nick Coghlan wrote: On 27 August 2014 08:52, Nick Coghlan wrote: On 27 Aug 2014 02:52, "Terry Reedy" wrote: Nick, I think the first half of your post is one of the clearest expositions yet of 'why Python 3' (in particular, the str to unicode change). It is worthy of wid

Re: [Python-Dev] Bytes path related questions for Guido

2014-08-27 Thread Glenn Linderman
On 8/26/2014 4:31 AM, MRAB wrote: On 2014-08-26 03:11, Stephen J. Turnbull wrote: Nick Coghlan writes: > "purge_surrogate_escapes" was the other term that occurred to me. "purge" suggests removal, not replacement. That may be useful too. neutralize_surrogate_escapes(s, remove=False, replac

Re: [Python-Dev] Bytes path related questions for Guido

2014-08-27 Thread Glenn Linderman
On 8/27/2014 6:08 PM, Stephen J. Turnbull wrote: Glenn Linderman writes: > On 8/26/2014 4:31 AM, MRAB wrote: > > On 2014-08-26 03:11, Stephen J. Turnbull wrote: > >> Nick Coghlan writes: > > How about: > > > > replace_surrogate_escapes(s, repl

Re: [Python-Dev] Bytes path related questions for Guido

2014-08-28 Thread Glenn Linderman
On 8/28/2014 12:30 AM, MRAB wrote: On 2014-08-28 05:56, Glenn Linderman wrote: On 8/27/2014 6:08 PM, Stephen J. Turnbull wrote: Glenn Linderman writes: > On 8/26/2014 4:31 AM, MRAB wrote: > > On 2014-08-26 03:11, Stephen J. Turnbull wrote: > >> Nick Coghlan writes

Re: [Python-Dev] Bytes path related questions for Guido

2014-08-28 Thread Glenn Linderman
On 8/28/2014 10:41 AM, R. David Murray wrote: On Thu, 28 Aug 2014 10:15:40 -0700, Glenn Linderman wrote: On 8/28/2014 12:30 AM, MRAB wrote: On 2014-08-28 05:56, Glenn Linderman wrote: On 8/27/2014 6:08 PM, Stephen J. Turnbull wrote: Glenn Linderman writes: > On 8/26/2014 4:31 AM, M

Re: [Python-Dev] Proposed schedule for 3.4.2

2014-09-08 Thread Glenn Linderman
Well, this thread seems to be top-posted so... Why not provide _urlopen_with_scary_keyword_parameter as the monkey-patch option? So after the (global to the module) monkeypatch, they would _still_ have to add the keyword parameter. On 9/8/2014 4:31 PM, Guido van Rossum wrote: I still p

Re: [Python-Dev] Proposed schedule for 3.4.2

2014-09-08 Thread Glenn Linderman
On 9/8/2014 8:41 PM, Stephen J. Turnbull wrote: > Why not provide _urlopen_with_scary_keyword_parameter as the > monkey-patch option? > > So after the (global to the module) monkeypatch, they would_still_ have > to add the keyword parameter. I understand the hardline position, though

Re: [Python-Dev] Multilingual programming article on the Red Hat Developer blog

2014-09-16 Thread Glenn Linderman
On 9/16/2014 5:21 PM, Stephen J. Turnbull wrote: It isn't, because the bytes/str problem was that given a str object out of context you could not tell whether it was a binary blob or text, and if text, you couldn't tell if it was external encoded text or internal abstract text. That is not true

Re: [Python-Dev] 3.5 release schedule PEP

2014-09-24 Thread Glenn Linderman
On 9/24/2014 6:59 PM, Chris Angelico wrote: That is, could pip defer the declaration until it's parsed its command line args and decided that it'll be installing into the system directory, but NOT make that declaration if it's given --user, or if it's running inside a venv, or anything else that

Re: [Python-Dev] mUTF-7 support?

2014-10-09 Thread Glenn Linderman
On 10/9/2014 7:41 PM, R. David Murray wrote: Specifically, it is about what we might better term mailbox *folders*...that is, not what you would normally think of as the 'mailbox name', which is usually understood to be the thing before the @ in the email address (and can't contain non-ASCII yet.

Re: [Python-Dev] Status of C compilers for Python on Windows

2014-10-28 Thread Glenn Linderman
On 10/28/2014 6:45 AM, Stephen J. Turnbull wrote: because it's a fork, it's a different name I think this is an important point, and first brought to this discussion here. A fork is _not_ called Python, but something else... but if it is kept extremely compatible and up-to-date in the hopes of

[Python-Dev] Impact of Windows PowerShell OneGet ?

2014-10-29 Thread Glenn Linderman
New package manager from M$... article here . It seems doubtful that M$ will eliminate .msi (their obscure, hard to configure and use, installation format), so it seems doubtful that the addition of OneGet

Re: [Python-Dev] Impact of Windows PowerShell OneGet ?

2014-10-30 Thread Glenn Linderman
On 10/30/2014 7:30 AM, "Martin v. Löwis" wrote: Most likely, OneGet won't replace pip/PyPI, any more than apt or yum does; but it may be worth having Python itself available that way. That might simply mean having someone package up Python and put it on an appropriate server, or maybe python.org

Re: [Python-Dev] Move selected documentation repos to PSF BitBucket account?

2014-11-23 Thread Glenn Linderman
On 11/23/2014 3:18 AM, Nick Coghlan wrote: Patches getting held up in the review queue for weeks or months is a *huge* barrier to contribution, as it prevents the formation of the positive feedback cycle where having a contribution accepted feels good, so folks are more likely to want to contri

Re: [Python-Dev] New Windows installer for Python 3.5

2015-01-03 Thread Glenn Linderman
General comments: I was a bit concerned when Steve first posted his plans for the Windows installer and making a web installer forcing re-downloads for every install, and expressed those privately. I'm no longer concerned, this outlined scheme is good, but I have some suggestions to make it gr

Re: [Python-Dev] New Windows installer for Python 3.5

2015-01-04 Thread Glenn Linderman
On 1/4/2015 2:56 PM, Steve Dower wrote: Unfortunately, I'm fairly restricted on naming convention. For some reason Windows Installer requires CAB files to be 8.3 names, where some of the 8 are reserved, so the names are pretty meaningless. Least common denominator, I'm sure. But a pretty stupid

Re: [Python-Dev] New Windows installer for Python 3.5

2015-01-09 Thread Glenn Linderman
On 1/9/2015 12:34 PM, David Anthoff wrote: Nothing is merged in yet and everything can still change, so I'm keen to hear whatever feedback people have. I've tried to make improvements fairly for first-time users through to sysadmins, but if I've missed something big I'd like to hear about it

Re: [Python-Dev] Pydoc Replacement for Python's help()?

2015-01-27 Thread Glenn Linderman
On 1/27/2015 8:04 AM, Cyd Haselton wrote: Noted. Will proceed with the 3.x releass. I had been excited you were working on Android Python until I realized you were working on 2.x. I started with Python 3, and have only dabbled in 2.x for a couple projects that had unported dependency needs. One

Re: [Python-Dev] PEP 370 - per-user scripts directory on Windows

2015-02-12 Thread Glenn Linderman
On 2/12/2015 9:39 AM, Ethan Furman wrote: On 02/12/2015 12:05 AM, Thomas Heller wrote: Could not py.exe be extended so that it allows starting scripts in a somewhat similar way? 'py-script -2.7 myscript foo bar baz' ??? Which would execute the script myscript.exe, myscript.bat, myscript.py, my

Re: [Python-Dev] PEP 370 - per-user scripts directory on Windows

2015-02-13 Thread Glenn Linderman
On 2/13/2015 1:13 AM, Paul Moore wrote: On 13 February 2015 at 06:59, Thomas Heller wrote: To make it clear: My suggestion is (or was, maybe it isn't a good idea) to have some way to start 'something' that is in the Scripts directory of a Python installation (which is usually a python script or

Re: [Python-Dev] PEP 441 - Improving Python ZIP Application Support

2015-02-17 Thread Glenn Linderman
On 2/17/2015 10:52 AM, Barry Warsaw wrote: Probably the best thing to do (on *nix at least) is, if the path is absolute, use the given string verbatim. If the path is relative, search for the given executable on $PATH and use the first one found. If nothing is found, use what's given explicitly

Re: [Python-Dev] PEP 441 - Improving Python ZIP Application Support

2015-02-17 Thread Glenn Linderman
On 2/17/2015 1:40 PM, Barry Warsaw wrote: I agree, for deployment to environments where you can guarantee that the basic Python infrastructure is available. It may not be though, and perhaps we can relegate that to py2exe, cx_freeze, and friends, although I would say that having such support bui

Re: [Python-Dev] Request for Pronouncement: PEP 441 - Improving Python ZIP Application Support

2015-02-26 Thread Glenn Linderman
On 2/26/2015 9:05 AM, Paul Moore wrote: On 24 February 2015 at 18:24, Guido van Rossum wrote: Here's my review. I really like where this is going but I have a few questions and suggestions (I can't help myself :-). OK, I've updated both the PEP and the patch based on follow-up discussions. I t

Re: [Python-Dev] backwards and forwards compatibility, the exact contents of pickle files, and IntEnum

2015-03-14 Thread Glenn Linderman
On 3/14/2015 10:52 PM, Ethan Furman wrote: I'm not sure exactly how to phrase this inquiry, so please bear with me. What exactly does backwards compatibility mean as far as pickle goes? We have the various protocols, we have the contents of pickle files created at those protocols, and we have

Re: [Python-Dev] 0-base and 1-base indexed iterables? Custom slicing rules?

2015-03-21 Thread Glenn Linderman
On 3/21/2015 10:46 PM, pedro santos wrote: Hi, I'm an Art and CG student learning Python and today's exercise was about positions in a tiled room. The fact that I had to check if a position was inside the room and given that in a 1x1 room, 0.0 was considered in and 1.0 was considered out, it

Re: [Python-Dev] Installing Python to non-ASCII paths

2015-03-22 Thread Glenn Linderman
On 3/22/2015 8:12 AM, Tim Golden wrote: I'll create a £££ user (which is the easiest non-ASCII name to create on a UK keyboard) to see how cleanly the latest installer works. You can also copy/paste. A path with a Cyrillic, Greek, Chinese, Tibetan, Japanese, Armenian, and Romanian character,

Re: [Python-Dev] Keyword-only parameters

2015-04-14 Thread Glenn Linderman
On 4/14/2015 2:14 PM, Guido van Rossum wrote: Also, why do you think we added the 'lone star' syntax? :-) Hint: Not because Guido is from Texas ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev U

Re: [Python-Dev] Surely "nullable" is a reasonable name?

2015-04-19 Thread Glenn Linderman
On 4/19/2015 1:19 AM, Larry Hastings wrote: On 08/07/2014 09:41 PM, Larry Hastings wrote: Well! It's rare that the core dev community is so consistent in its opinion. I still think "nullable" is totally appropriate, but I'll change it to "allow_none". (reviving eight-month-old thread)

Re: [Python-Dev] PEP 492: No new syntax is required

2015-04-28 Thread Glenn Linderman
On 4/26/2015 4:32 PM, Paul Sokolovsky wrote: Then, is the only logic for proposing __aenter__ is to reinsure against a situation that someone starts to write async context manager, forgets that they write async context manager, and make an __enter__ method there. Then your implementation will ann

Re: [Python-Dev] A macro for easier rich comparisons

2015-04-28 Thread Glenn Linderman
On 4/28/2015 2:13 AM, Victor Stinner wrote: #define Py_RETURN_RICHCOMPARE(val1, val2, op) \ > do {\ > switch (op) { \ > case

Re: [Python-Dev] PEP 492: async/await in Python; version 4

2015-05-01 Thread Glenn Linderman
On 5/1/2015 9:59 AM, Guido van Rossum wrote: I think coroutine is the name of a concept, not a specific implementation. Cheers, Cheers indeed! I agree that the *concept* is best called coroutine -- and we have used this term ever since PEP 342. But when we're talking specifics a

Re: [Python-Dev] Unicode literals in Python 2.7

2015-05-09 Thread Glenn Linderman
On 5/9/2015 5:39 AM, Adam Bartoš wrote: I already have a solution in Python 3 (see https://github.com/Drekin/win-unicode-console, https://pypi.python.org/pypi/win_unicode_console), I was just considering adding support for Python 2 as well. I think I have an working example in Python 2 using c

Re: [Python-Dev] Unicode literals in Python 2.7

2015-05-11 Thread Glenn Linderman
On 5/11/2015 1:09 AM, Nick Coghlan wrote: On 10 May 2015 at 23:28, Adam Bartoš wrote: Glenn Linderman wrote: Is this going to get released in 3.5, I hope? Python 3 is pretty limited without some solution for Unicode on the console... probably the biggest deficiency I have found in Python 3

Re: [Python-Dev] PEP 553: Built-in debug()

2017-09-07 Thread Glenn Linderman
On 9/7/2017 4:19 PM, Terry Reedy wrote: A somewhat separate point: the name breakpoint() is slightly misleading, which has consequences if it is (improperly) called more than once. While breakpoint() acts as a breakpoint, what it does (at least in the default pdb case) is *initialize* and start

Re: [Python-Dev] PEP 557: Data Classes

2017-09-18 Thread Glenn Linderman
On 9/18/2017 11:37 AM, Ethan Furman wrote: On 09/11/2017 03:28 PM, Guido van Rossum wrote: Oddly I don't like the enum (flag names get too long that way), but I do agree with everything else Barry said (it should be a trivalue flag and please don't name it cmp). Hmmm, named constants are one

Re: [Python-Dev] Investigating time for `import requests`

2017-10-01 Thread Glenn Linderman
On 10/1/2017 7:34 PM, Nathaniel Smith wrote: Another major slowness comes from compiling regular expression. I think we can increase cache size of `re.compile` and use ondemand cached compiling (e.g. `re.match()`), instead of "compile at import time" in many modules. In principle re.compile() it

Re: [Python-Dev] PEP 553

2017-10-04 Thread Glenn Linderman
On 10/4/2017 5:22 PM, Yarko Tymciurak wrote: Barry suggested I bring this up here. It seems the right time to at least discuss this: RE:  PEP 553 enabling / disabling breakpoints --- I've recently started using a simple conditional breakpoint in ipython, and wonder if  - in addition to Nick C

Re: [Python-Dev] Add a developer mode to Python: -X dev command line option

2017-11-16 Thread Glenn Linderman
On 11/16/2017 7:39 AM, Barry Warsaw wrote: On Nov 16, 2017, at 09:47, Yury Selivanov wrote: Let's keep it simple. I'm big -1 on adding different "debug levels", they are always confusing. Oh, this one’s easy. -X dev == some debugging -X deve == a little more -X devel == give

Re: [Python-Dev] Python initialization and embedded Python

2017-11-23 Thread Glenn Linderman
On 11/23/2017 5:31 PM, Nick Coghlan wrote: - a consolidated list of *all* the APIs that can safely be called before Py_Initialize So it is interesting to know that list, of course, but the ones that are to be supported and documented might be a smaller list. Or might not. ___

Re: [Python-Dev] Accepting PEP 562 -- Module __getattr__ and __dir__

2017-12-04 Thread Glenn Linderman
The word "a" is extraneous/confusing-in-grammar in the first line of the abstract also. I can't fix it. On 12/4/2017 9:46 AM, Victor Stinner wrote: Link for lazy people like me: https://www.python.org/dev/peps/pep-0562/ I changed the PEP status to fix a typo in the abstract: https://github.com

Re: [Python-Dev] PEP 540: Add a new UTF-8 mode (v2)

2017-12-05 Thread Glenn Linderman
On 12/5/2017 8:07 PM, INADA Naoki wrote: Oh, revised version is really short! And I have one worrying point. With UTF-8 mode, open()'s default encoding/error handler is UTF-8/surrogateescape. Containers are really growing. PyCharm supports Docker and many new Python developers use Docker inste

Re: [Python-Dev] PEP 540: Add a new UTF-8 mode (v2)

2017-12-07 Thread Glenn Linderman
On 12/7/2017 4:48 PM, Victor Stinner wrote: Ok, now comes the real question, open(). For open(), I used the example of a code snippet *writing* the content of a directory (os.listdir) into a text file. Another example is to read filenames from a text files but pass-through undecodable bytes tha

Re: [Python-Dev] PEP 540: Add a new UTF-8 mode (v2)

2017-12-07 Thread Glenn Linderman
On 12/7/2017 5:45 PM, Jonathan Goble wrote: On Thu, Dec 7, 2017 at 8:38 PM Glenn Linderman <mailto:v%2bpyt...@g.nevcal.com>> wrote: If it were to be changed, one could add a text-mode option in 3.7, say "t" in the mode string, and a PendingDeprecationWarning for

Re: [Python-Dev] Support of the Android platform

2017-12-15 Thread Glenn Linderman
On 12/15/2017 8:29 AM, Xavier de Gaye wrote: On 12/14/2017 02:59 PM, Victor Stinner wrote: > It seems like Android is evolving quickly, would say quicker than > Python releases. I'm asking if it's a good idea to put a recipe aside > the Python source code for one specific Android API version? Wou

Re: [Python-Dev] Guarantee ordered dict literals in v3.7?

2017-12-19 Thread Glenn Linderman
On 12/19/2017 5:32 PM, Nathaniel Smith wrote: On Tue, Dec 19, 2017 at 4:56 PM, Steve Dower wrote: On 19Dec2017 1004, Chris Barker wrote: Nathaniel Smith has pointed out that eval(pprint(a_dict)) is supposed to return the same dict -- so documented behavior may already be broken. Two relevant

Re: [Python-Dev] PEP 567 v2

2018-01-03 Thread Glenn Linderman
On 1/3/2018 11:16 AM, Guido van Rossum wrote: Maybe I should clarify again what run() does. Here's how I think of it in pseudo code: def run(self, func, *args, **kwds):     old = _get_current_context()     new = old.copy()     _set_current_context(new)     try:     return func(*args, **kwds

Re: [Python-Dev] Making "-j0" the default setting for the test suite?

2018-01-28 Thread Glenn Linderman
On 1/28/2018 9:15 PM, Terry Reedy wrote: The speedup would be even better but for the last very long running test. Could the last very long running test be started first, instead? (maybe it is, or maybe there are reasons not to) ___ Python-Dev mailing

Re: [Python-Dev] Friendly reminder: be kind to one another

2018-01-29 Thread Glenn Linderman
On 1/29/2018 6:16 PM, Brett Cannon wrote: Over the last 3 days I have had two situations come up where I was asked for my opinion in regards to possible CoC violations. I just wanted to take this opportunity to remind everyone that open source does not work if we are not open, considerate, and

Re: [Python-Dev] Dataclasses and correct hashability

2018-02-04 Thread Glenn Linderman
On 2/4/2018 9:49 PM, Guido van Rossum wrote: A frozen class requires a lot of discipline, since you have to compute the values of all fields before calling the constructor. A mutable class allows other initialization patterns, e.g. manually setting some fields after the instance has been constr

Re: [Python-Dev] Dataclasses and correct hashability

2018-02-05 Thread Glenn Linderman
On 2/5/2018 12:11 AM, Nathaniel Smith wrote: On Sun, Feb 4, 2018 at 11:28 PM, Glenn Linderman wrote: This is an interesting use case. I haven't got the internals knowledge to know just how just different mutable and immutable classes and objects are under the hood. But this use case mak

Re: [Python-Dev] Dataclasses, frozen and __post_init__

2018-02-19 Thread Glenn Linderman
On 2/19/2018 7:02 PM, Guido van Rossum wrote: But how? On Mon, Feb 19, 2018 at 5:06 PM, Chris Barker - NOAA Federal mailto:chris.bar...@noaa.gov>> wrote: ... maybe it would be helpful to be able to freeze an instance after creation for multiple use-cases? And there's the crux of th

Re: [Python-Dev] Enum, Flag, __contains__, and False vs TypeError

2018-04-04 Thread Glenn Linderman
On 4/4/2018 11:32 AM, Ethan Furman wrote: API question. Background: -- When doing checks such as --> 3 in [4, 5, 6] --> 'test' in {'test':True, 'live':False} the result is True or False. When doing checks such as --> 3 in 'hello world' --> [4, 5, 6] in {'test':True, 'live':False} t

Re: [Python-Dev] Is it useful to update cgitb module?

2018-04-07 Thread Glenn Linderman
On 4/7/2018 9:45 PM, Alex Walters wrote: Are there people still actively developing new cgi scripts in python? I know some modern HTTPDs don’t even support classic cgi without some kind of fastcgi daemon in between. I am aware that some parts of various wsgi tools use the cgi module, but is

Re: [Python-Dev] PEP 572: Assignment Expressions

2018-04-17 Thread Glenn Linderman
On 4/17/2018 12:46 AM, Chris Angelico wrote: gen = (x for x in rage(10)) # NameError gen = (x for x in 10) # TypeError (not iterable) gen = (x for x in range(1/0)) # Exception raised during evaluation This brings such generator expressions in line with a simple translation to func

Re: [Python-Dev] PEP 572: Assignment Expressions

2018-04-23 Thread Glenn Linderman
On 4/23/2018 1:01 PM, Ethan Furman wrote: On 04/22/2018 10:44 PM, Tim Peters wrote: [Guido] In reality there often are other conditions being applied to the match for which `if expr as name` is inadequate. The simplest would be something like    if ...:       elif (m := re.match('(.*):(

Re: [Python-Dev] PEP 572: Write vs Read, Understand and Control Flow

2018-04-24 Thread Glenn Linderman
On 4/24/2018 8:56 PM, Tim Peters wrote: The alternative is typing the sub-expression(s) of interest by hand at the debugger prompt, or adding print()s, both of which are prone to introducing typos, or changing results radically due to triggering side effects in the code invoked by the duplicate

Re: [Python-Dev] PEP 572: Write vs Read, Understand and Control Flow

2018-04-25 Thread Glenn Linderman
On 4/24/2018 6:10 PM, Tim Peters wrote: Luckily, I only have to write code for me now, so am free to pick the perfect compromise in every case;-) QOTD !  I'm in the same situation. ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.o

Re: [Python-Dev] (name := expression) doesn't fit the narrative of PEP 20

2018-04-27 Thread Glenn Linderman
On 4/27/2018 2:11 PM, Tim Peters wrote: That's easy: any time there's a long thread to which Guido has contributed at least twice, it will be seen as a Golden Opportunity to re-litigate every decision that's ever been made;-) You're getting pretty good at that QOTD thing, Tim :) ___

Re: [Python-Dev] Python startup time

2018-05-02 Thread Glenn Linderman
On 5/2/2018 8:56 PM, Gregory Szorc wrote: Nobody in the project is seriously talking about a complete rewrite in Rust. Contributors to the project have varying opinions on how aggressively Rust should be utilized. People who contribute to the C code, low-level primitives (like storage, deltas,

Re: [Python-Dev] A fast startup patch (was: Python startup time)

2018-05-05 Thread Glenn Linderman
On 5/5/2018 10:30 AM, Toshio Kuratomi wrote: On Fri, May 4, 2018, 7:00 PM Nathaniel Smith > wrote: What are the obstacles to including "preloaded" objects in regular .pyc files, so that everyone can take advantage of this without rebuilding the interpreter? W

Re: [Python-Dev] Slow down...

2018-05-07 Thread Glenn Linderman
On 5/7/2018 7:59 AM, Eric Snow wrote: On Sun, May 6, 2018 at 8:25 PM, Nick Coghlan wrote: I'm inclined to agree that a Python 3.8 PEP in the spirit of the PEP 3003 language moratorium could be a very good idea. Note that the PEP specifically applies to "syntax, semantics, and built-ins". Here

Re: [Python-Dev] Single-file Python executables (was: Computed Goto dispatch for Python 2)

2015-05-28 Thread Glenn Linderman
On 5/28/2015 12:26 PM, Paul Moore wrote: On 28 May 2015 at 19:22, Chris Angelico wrote: Unfortunately (and believe me, I've been down this road many times) on Windows *only* the exe format is a "first-class" executable. Executable scripts and shebangs are very useful, but there are always corne

Re: [Python-Dev] Single-file Python executables (was: Computed Goto dispatch for Python 2)

2015-05-29 Thread Glenn Linderman
On 5/29/2015 3:33 AM, Paul Moore wrote: On 28 May 2015 at 22:09, Glenn Linderman wrote: This would be something I could use and benefit from immediately upon it being available, so I laud your idea, and hope you have a successful implementation, and look forward to using it. It would largely

Re: [Python-Dev] Single-file Python executables (was: Computed Goto dispatch for Python 2)

2015-05-29 Thread Glenn Linderman
On 5/29/2015 2:45 PM, Paul Moore wrote: On 29 May 2015 at 21:49, Glenn Linderman wrote: That looks interesting, I wonder what compilation environment it would need? I don't think I've even installed a C compiler on my last couple boxes, and the only version of a C compiler I have is

Re: [Python-Dev] Single-file Python executables (was: Computed Goto dispatch for Python 2)

2015-05-29 Thread Glenn Linderman
On 5/29/2015 3:28 PM, Paul Moore wrote: On 29 May 2015 at 23:15, Glenn Linderman wrote: I don't presently see any C:\Python34\DLLs or C:\Python34 on my path, but I didn't ask the installer to put it there either. So I'm guessing your option 1 assumes asking the Python installer

Re: [Python-Dev] Where are bugs with the web site reported?

2015-07-16 Thread Glenn Linderman
On 7/16/2015 12:11 PM, Ryan Gonzalez wrote: I have encountered this weird issue on Chrome for Android where scrolling up just a little causes the page to dart to the top. I was going to report it in the bug tracker, but I didn't see a label for the web site itself. Worst part is, this is stop

Re: [Python-Dev] Status on PEP-431 Timezones

2015-07-27 Thread Glenn Linderman
On 7/27/2015 1:42 PM, Lennart Regebro wrote: On Mon, Jul 27, 2015 at 9:47 PM, Ethan Furman wrote: On 07/27/2015 07:46 AM, Lennart Regebro wrote: Well, OK, let's propose these wordings: It looks like a date operation, ie, add one to the date, but in reality it's a time operation, ie add 86400 s

Re: [Python-Dev] PEP 495 Was: PEP 498: Literal String Interpolation is ready for pronouncement

2015-09-11 Thread Glenn Linderman
On 9/11/2015 5:40 PM, Alexander Belopolsky wrote: The insanity I am dealing with now ... But the decision to allow interzone t - s was made long time ago and it is a PEP 495 goal to change that. The first few paragraphs you wrote, which I elided, are a great explanation of why things work i

Re: [Python-Dev] PEP 495 Was: PEP 498: Literal String Interpolation is ready for pronouncement

2015-09-11 Thread Glenn Linderman
On 9/11/2015 6:39 PM, Alexander Belopolsky wrote: On Fri, Sep 11, 2015 at 9:12 PM, Glenn Linderman mailto:v+pyt...@g.nevcal.com>> wrote: That's what the politicians gave us. These are datetime objects, not mathematical numbers. That's an argument for not defin

Re: [Python-Dev] If you shadow a module in the standard library that IDLE depends on, bad things happen

2015-10-29 Thread Glenn Linderman
On 10/29/2015 12:30 PM, Paul Moore wrote: On 29 October 2015 at 18:45, Donald Stufft wrote: So I don=E2=80=99t think it=E2=80=99s true that people don=E2=80=99t shad= ow the standard library, they just have various ways to do it that have s= everal gotchas and require people to generally hack a

Re: [Python-Dev] Support of UTF-16 and UTF-32 source encodings

2015-11-14 Thread Glenn Linderman
On 11/14/2015 3:21 PM, Serhiy Storchaka wrote: On 15.11.15 00:56, Victor Stinner wrote: These encodings are rarely used. I don't think that any text editor use them. Editors use ascii, latin1, utf8 and... all locale encoding. But I don't know any OS using UTF-16 as a locale encoding. UTF-32 wast

Re: [Python-Dev] Support of UTF-16 and UTF-32 source encodings

2015-11-14 Thread Glenn Linderman
On 11/14/2015 5:15 PM, Chris Angelico wrote: Can the py.exe launcher handle a UTF-16 shebang? (I'm pretty sure Unix program loaders won't.) That alone might be a reason for strongly encouraging ASCII-compat encodings. That raises an interesting question about if py.exe can handle a leading UTF

Re: [Python-Dev] Support of UTF-16 and UTF-32 source encodings

2015-11-14 Thread Glenn Linderman
On 11/14/2015 5:15 PM, Chris Angelico wrote: I think even Notepad defaults to UTF-8 for files, now. Just installed Windows 10 on a new machine, and upgraded to the latest Windows 10 release, 1511. Notepad defaults to ANSI encoding, as I think it always has. UTF-8 is an option, and it does

Re: [Python-Dev] Support of UTF-16 and UTF-32 source encodings

2015-11-14 Thread Glenn Linderman
On 11/14/2015 5:37 PM, Chris Angelico wrote: On Sun, Nov 15, 2015 at 12:27 PM, Glenn Linderman wrote: Notepad defaults to ANSI encoding, as I think it always has. UTF-8 is an option, and it does seem to try to notice the original encoding of the file, when editing old files, but when creating

Re: [Python-Dev] Python Language Reference has no mention of list comÃprehensions

2015-12-03 Thread Glenn Linderman
On 12/3/2015 5:56 PM, Chris Angelico wrote: You come across something syntactic that begins by opening a square bracket, and you know that its semantics are: "construct a new list". That's what's common here. What goes*inside* those brackets can be one of two things: 1) A (possibly empty) comm

Re: [Python-Dev] Asynchronous context manager in a typical network server

2015-12-18 Thread Glenn Linderman
On 12/18/2015 10:36 AM, Guido van Rossum wrote: I was opted to the signal module because `signal` documentation suggest that it alos supports Windows while asyncio documentation states that `loop. add_signal_handler()` is UNIX only. Unfortunately that's true, but using the

Re: [Python-Dev] Update PEP 7 to require curly braces in C

2016-01-18 Thread Glenn Linderman
On 1/18/2016 9:16 PM, Greg Ewing wrote: Alexander Walters wrote: I am not a core developer, but I just kind of feel its hypocritical to oppose always using brackets for the development of *python* If we were being *really* pythonic, we would write all the C code without any braces at all, and

Re: [Python-Dev] PEP 509: Add a private version to dict

2016-01-20 Thread Glenn Linderman
On 1/20/2016 10:36 AM, Maciej Fijalkowski wrote: Why can't you simply use the id of the dict object as the globally unique >dict ID? It's already globally unique amongst all Python objects which makes >it inherently unique amongst dicts. > >___ >Python-

Re: [Python-Dev] PEP 509: Add a private version to dict

2016-01-20 Thread Glenn Linderman
On 1/20/2016 12:50 PM, Brett Cannon wrote: A global (shared between all dicts) unit64 ma_version is actually quite reliable -- if a program does 1,000,000 dict modifications per second, it would take it 600,000 years till wrap-around. But would invalidate everything, instead o

Re: [Python-Dev] PEP 509: Add a private version to dict

2016-01-20 Thread Glenn Linderman
On 1/20/2016 4:08 PM, Brett Cannon wrote: On Wed, 20 Jan 2016 at 15:46 Victor Stinner <mailto:victor.stin...@gmail.com>> wrote: Hi, 2016-01-20 22:18 GMT+01:00 Glenn Linderman mailto:v%2bpyt...@g.nevcal.com>>: > On 1/20/2016 12:50 PM, Brett Cannon wrote:

Re: [Python-Dev] FAT Python (lack of) performance

2016-01-27 Thread Glenn Linderman
On 1/27/2016 9:12 AM, Stephen J. Turnbull wrote: Without that knowledge and effort, choosing a programming language based on microbenchmarks is like choosing a car based on the leg-length of the model sitting on the hood in the TV commercial. +1 QOTD ___

Re: [Python-Dev] Speeding up CPython 5-10%

2016-01-27 Thread Glenn Linderman
On 1/27/2016 12:37 PM, Yury Selivanov wrote: MicroPython also has dictionary lookup caching, but it's a bit different to your proposal. We do something much simpler: each opcode that has a cache ability (eg LOAD_GLOBAL, STORE_GLOBAL, LOAD_ATTR, etc) includes a single byte in the opcode which

Re: [Python-Dev] Python environment registration in the Windows Registry

2016-02-03 Thread Glenn Linderman
On 2/3/2016 12:15 AM, Alexander Walters wrote: On a very personal note (like the rest of this wasn't my personal issues with possibly making my life slightly more difficult), I would much rather see python stop touching the registry all together - but I have no strong argument for that. Me t

Re: [Python-Dev] PEP 515: Underscores in Numeric Literals

2016-02-10 Thread Glenn Linderman
On 2/10/2016 2:20 PM, Georg Brandl wrote: This came up in python-ideas, and has met mostly positive comments, although the exact syntax rules are up for discussion. cheers, Georg PEP: 515 Title: Underscores in Num

Re: [Python-Dev] PEP 515: Underscores in Numeric Literals

2016-02-11 Thread Glenn Linderman
On 2/11/2016 11:01 AM, Ethan Furman wrote: On 02/11/2016 10:50 AM, Serhiy Storchaka wrote: > I have strong preference for more strict and simpler rule, used by > most other languages -- "only between two digits". Main arguments: > 2. Most languages use this rule. It is better to follow non-forma

Re: [Python-Dev] PEP 515: Underscores in Numeric Literals

2016-02-11 Thread Glenn Linderman
On 2/11/2016 12:22 AM, Georg Brandl wrote: Hey all, based on the feedback so far, I revised the PEP. There is now a much simpler rule for allowed underscores, with no exceptions. This made the grammar simpler as well. +1 overall Examples:: # grouping decimal numbers by thousands

Re: [Python-Dev] PEP 515: Underscores in Numeric Literals

2016-02-11 Thread Glenn Linderman
On 2/11/2016 4:16 PM, Steven D'Aprano wrote: On Thu, Feb 11, 2016 at 06:03:34PM +, Brett Cannon wrote: On Thu, 11 Feb 2016 at 02:13 Steven D'Aprano wrote: On Wed, Feb 10, 2016 at 08:41:27PM -0800, Andrew Barnert wrote: And honestly, are you really claiming that in your opinion, "123_456

Re: [Python-Dev] PEP 515: Underscores in Numeric Literals

2016-02-11 Thread Glenn Linderman
On 2/11/2016 7:56 PM, David Mertz wrote: Great PEP overall. We definitely don't want the restriction to grouping numbers only in threes. South Asian crore use grouping in twos. https://en.m.wikipedia.org/wiki/Crore Interesting... 3 digits in the least significant group, and _then_ by twos

  1   2   3   4   5   6   7   >