[Python-Dev] Compacting the Uncompactable

2019-09-28 Thread MRAB
Here's a video about memory fragmentation and compaction that you might find interesting: "Compacting the Uncompactable" by Bobby Powers https://www.youtube.com/watch?v=c1UBJbfR-H0 ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe

[Python-Dev] Re: static variables in CPython - duplicated _Py_IDENTIFIERs?

2019-09-23 Thread MRAB
On 2019-09-23 21:22, Vinay Sajip via Python-Dev wrote: OK - but that's just one I picked at random. There are others like it - what would be the process for deciding which ones need to be made private and moved? Should an issue be raised to track this? It's not really a question of which ones

[Python-Dev] Re: Spammy stuff (was Re: congrats on 3.5! Alas, windows 7 users are having problems installing it)

2019-09-15 Thread MRAB
On 2019-09-15 23:40, Michael Foord wrote: Sent from my iPhone On 15 Sep 2019, at 23:25, Tim Peters wrote: [Tim] While python-dev has several "official" moderators, best I can tell I'm the only one who has reviewed these messages for years. I should clarify that! That's not meant to be

[Python-Dev] Re: What to do about invalid escape sequences

2019-08-09 Thread MRAB
On 2019-08-09 23:56, Steven D'Aprano wrote: I'm not trying to be confrontational, I'm trying to understand your use-case(s) and see if it would be broken by the planned change to string escapes. On Fri, Aug 09, 2019 at 03:18:29PM -0700, Glenn Linderman wrote: On 8/9/2019 2:53 PM, Steven

[Python-Dev] Re: What to do about invalid escape sequences

2019-08-07 Thread MRAB
On 2019-08-07 23:43, Steve Holden wrote: This whole thread would be an excellent justification for following 3.9 with 4.0. It's as near as we ever want to get to a breaking change, and a major version number would indicate the need to review. If increasing strictness of escape code

[Python-Dev] Re: What to do about invalid escape sequences

2019-08-06 Thread MRAB
On 2019-08-06 17:32, Matt Billenstein wrote: On Mon, Aug 05, 2019 at 04:22:50AM -, raymond.hettin...@gmail.com wrote: This once seemed like a reasonable and innocuous idea to me; however, I've been using the 3.8 beta heavily for a month and no longer think it is a good idea. The warning

[Python-Dev] Re: Comparing dict.values()

2019-07-23 Thread MRAB
On 2019-07-23 21:59, Kristian Klette wrote: Hi! During the sprints after EuroPython, I made an attempt at adding support for comparing the results from `.values()` of two dicts. Currently the following works as expected: ``` d = {'a': 1234} d.keys() == d.keys() d.items() == d.items() ```

[Python-Dev] Re: strip behavior provides inconsistent results with certain strings

2019-06-28 Thread MRAB
On 2019-06-28 03:40, Glenn Linderman wrote: On 6/27/2019 3:09 PM, Brett Cannon wrote: My guess is that without Guido to just ask this will have to go to a PEP as it changes a built-in. How does adding two new methods change a built-in? Now if an extra parameter were added to modify lstrip,

[Python-Dev] Re: Who uses libpython38.a on Windows?

2019-06-14 Thread MRAB
On 2019-06-14 21:53, Steve Dower wrote: One of the most annoying steps in building the Windows installers is generating the libpython38.a file. It's annoying, because it requires having "generic enough" MinGW tools to ensure that the file is compatible with whatever version of MinGW might be

Re: [Python-Dev] [PEP 558] thinking through locals() semantics

2019-06-02 Thread MRAB
On 2019-06-02 13:51, Steven D'Aprano wrote: On Sun, Jun 02, 2019 at 11:52:02PM +1200, Greg Ewing wrote: Armin Rigo wrote: >You have the occasional big function that benefits a lot from being >JIT-compiled but which contains ``.format(**locals())``. There should be a lot less need for that now

Re: [Python-Dev] Python in next Windows 10 update

2019-05-21 Thread MRAB
On 2019-05-21 21:30, Steve Dower wrote: [snip] The associated blog post: https://devblogs.microsoft.com/python/python-in-the-windows-10-may-2019-update/ Here are answers to a few questions that I assume will come up, at least from this audience that understands the issues better than most: *

Re: [Python-Dev] (no subject)

2019-04-10 Thread MRAB
On 2019-04-10 22:00, Terry Reedy wrote: On 4/10/2019 7:24 AM, Robert Okadar wrote: Hi community, I have developed a tkinter GUI component, Python v3.7. It runs very well in Linux but seeing a huge performance impact in Windows 10. While in Linux an almost real-time performance is achieved, in

Re: [Python-Dev] Best way to specify docstrings for member objects

2019-03-19 Thread MRAB
On 2019-03-19 18:55, Raymond Hettinger wrote: I'm working on ways to make improve help() by giving docstrings to member objects. One way to do it is to wait until after the class definition and then make individual, direct assignments to __doc__ attributes.This way widely the separates

Re: [Python-Dev] Summary of Python tracker Issues

2019-02-28 Thread MRAB
On 2019-02-28 23:54, Glenn Linderman wrote: On 2/28/2019 2:52 PM, Terry Reedy wrote: On 2/28/2019 5:38 PM, Glenn Linderman wrote: On 2/28/2019 2:18 PM, Jonathan Goble wrote: On Thu, Feb 28, 2019, 5:11 PM Terry Reedy > wrote:     On 2/28/2019 8:07 AM, Jonathan Goble

Re: [Python-Dev] Making PyInterpreterState an opaque type

2019-02-21 Thread MRAB
On 2019-02-21 12:53, Antoine Pitrou wrote: On Thu, 21 Feb 2019 13:45:05 +0100 Victor Stinner wrote: Le jeu. 21 févr. 2019 à 12:36, Antoine Pitrou a écrit : > > On Thu, 21 Feb 2019 12:13:51 +0100 > Victor Stinner wrote: > > > > Premature optimization is the root of all evil. Most C

Re: [Python-Dev] Add more SyntaxWarnings?

2019-01-30 Thread MRAB
On 2019-01-30 18:12, Stefan Behnel wrote: MRAB schrieb am 29.01.19 um 19:55: On 2019-01-29 13:44, Nick Coghlan wrote: FWIW, we have pretty decent evidence that error messages don't have to provide a wonderful explanation on their own in order to be helpful: they just need to be distinctive

Re: [Python-Dev] Add more SyntaxWarnings?

2019-01-29 Thread MRAB
On 2019-01-29 13:44, Nick Coghlan wrote: On Tue, 29 Jan 2019 at 14:47, Stephen J. Turnbull wrote: I don't disagree. I disagree with the conclusion that it's worth the effort to try to improve all error messages that confuse new users, because new users (by definition) don't know enough to

Re: [Python-Dev] ctypes: is it intentional that id() is the only way to get the address of an object?

2019-01-18 Thread MRAB
On 2019-01-19 00:28, Greg Ewing wrote: Tim Peters wrote: The dict itself keeps the objects alive. Yes, but the idea of a cache is that you're free to flush things out of it to make room for something else without breaking anything. It sounds like MRAB is using ids as weak references

Re: [Python-Dev] ctypes: is it intentional that id() is the only way to get the address of an object?

2019-01-18 Thread MRAB
On 2019-01-18 23:02, Greg Ewing wrote: MRAB wrote: If I want to cache some objects, I put them in a dict, using the id as the key. If I wanted to locate an object in a cache and didn't have id(), I'd have to do a linear search for it. That sounds dangerous. An id() is only valid as long

Re: [Python-Dev] ctypes: is it intentional that id() is the only way to get the address of an object?

2019-01-17 Thread MRAB
On 2019-01-18 00:48, Gregory P. Smith wrote: I've heard that libraries using ctypes, cffi, or cython code of various sorts in the real world wild today does abuse the unfortunate side effect of CPython's implementation of id(). I don't have specific instances of this in mind but trust what

Re: [Python-Dev] C API changes

2018-11-26 Thread MRAB
On 2018-11-27 00:08, Larry Hastings wrote: On 11/23/18 5:15 AM, Armin Rigo wrote: Also FWIW, my own 2 cents on the topic of changing the C API: let's entirely drop ``PyObject *`` and instead use more opaque handles---like a ``PyHandle`` that is defined as a pointer-sized C type but is not

Re: [Python-Dev] Standardize error message for non-pickleable types

2018-10-30 Thread MRAB
On 2018-10-30 08:12, Serhiy Storchaka wrote: 29.10.18 23:17, MRAB пише: 1. If you're pickling, then saying "pickle" is more helpful. 2. In English the usual long form is "cannot". Error messages tend to avoid abbreviations, and also tend to have lowercase

Re: [Python-Dev] Standardize error message for non-pickleable types

2018-10-29 Thread MRAB
On 2018-10-29 22:21, Steven D'Aprano wrote: On Mon, Oct 29, 2018 at 08:51:34PM +0100, Victor Stinner wrote: Le lun. 29 oct. 2018 à 20:42, Serhiy Storchaka a écrit : > 1. "pickle" or "serialize"? serialize -1 Serializing is more general; pickle is merely one form of serializing:

Re: [Python-Dev] Standardize error message for non-pickleable types

2018-10-29 Thread MRAB
On 2018-10-29 19:38, Serhiy Storchaka wrote: When you try to to pickle or copy a non-pickleable object, you will get an error. In most cases this will be a TypeError with one of few similar, but different variants: "can't pickle XXX objects" (default) "Cannot serialize XXX object"

[Python-Dev] LibSSH Vulnerability

2018-10-18 Thread MRAB
I wondered if any of you have heard of this: Hacker: I'm logged in. New LibSSH Vulnerability: OK! I believe you. https://www.bleepingcomputer.com/news/security/hacker-im-logged-in-new-libssh-vulnerability-ok-i-believe-you/ ___ Python-Dev mailing list

Re: [Python-Dev] Official citation for Python

2018-09-17 Thread MRAB
On 2018-09-17 05:05, Jeremy Hylton wrote: I wanted to start with an easy answer that is surely unsatisfying: http://blog.apastyle.org/apastyle/2015/01/how-to-cite-software-in-apa-style.html APA style is pretty popular, and it says that standard software doesn't need to be specified. Standard

Re: [Python-Dev] bpo-34595: How to format a type name?

2018-09-11 Thread MRAB
On 2018-09-12 02:00, Ethan Furman wrote: On 09/11/2018 05:21 PM, Barry Warsaw wrote: MRAB wrote on 9/11/18 16:06: Perhaps we could have a single format code plus an optional '#' for the "alternate form": %T for short form %#T for fully qualified name OTOH, if %T and variants m

Re: [Python-Dev] bpo-34595: How to format a type name?

2018-09-11 Thread MRAB
On 2018-09-11 23:23, Victor Stinner wrote: Hi, Last week, I opened an issue to propose to add a new %T formatter to PyUnicode_FromFormatV() and so indirectly to PyUnicode_FromFormat() and PyErr_Format(): https://bugs.python.org/issue34595 I merged my change, but then Serhiy Storchaka

Re: [Python-Dev] [python-committers] [RELEASED] Python 3.4.9 and Python 3.5.6 are now available

2018-08-05 Thread MRAB
On 2018-08-05 19:57, Michael wrote: On 03/08/2018 03:22, Larry Hastings wrote: On 08/02/2018 07:17 AM, Victor Stinner wrote: 3.4.9 and 3.5.6 have no more known security vulnerabilities :-) Well, not to be a complete pill, but... https://bugs.python.org/issue17180

Re: [Python-Dev] [PEP 576/580] Comparing PEP 576 and 580

2018-07-31 Thread MRAB
On 2018-07-31 10:07, Jeroen Demeyer wrote: On 2018-07-31 09:36, INADA Naoki wrote: [snip] I would like to stress that PEP 580 was designed for maximum performance, both today and for future extensions (such as calling with native C types). I don't know what the word *stress* mean here.

Re: [Python-Dev] PEP 572 and assert

2018-07-17 Thread MRAB
On 2018-07-17 19:34, Tim Peters wrote: [Barry Warsaw] Thanks!  I thought it was cute.  It was just something that occurred to me as I was reviewing some existing code.  The intent wasn’t to use `subdirs` outside of the assert statement, but I’m warm to it because it means I

[Python-Dev] Encoding variable-length integers/counts in pickle

2018-07-09 Thread MRAB
In the regex module I use an encoding scheme when pickling pattern objects which is based on the way MIDI encodes variable-length integers, and I think it might have a use in a pickle protocol. In the basic format, an integer is split up into 7-bit chunks, each chunk put into a byte, and the

Re: [Python-Dev] PEP 572: intended scope of assignment expression

2018-07-05 Thread MRAB
On 2018-07-05 16:07, Victor Stinner wrote: 2018-07-05 15:14 GMT+02:00 Gustavo Carneiro : I don't know if you're trying to propose something clever here, like "if (x := func()):" would assign to 'x' only inside the "then" body of the if, but IMHO that would be a terrible idea: I don't propose

Re: [Python-Dev] Assignment expression and coding style: the while True case

2018-07-04 Thread MRAB
On 2018-07-05 01:11, Victor Stinner wrote: The code comes from Lib/_pyio.py. Simplified code: --- nodata_val = b"" ... if n is None or n == -1: ... current_size = 0 while True: chunk = self.raw.read() if chunk in empty_values: nodata_val = chunk

Re: [Python-Dev] Assignment expression and coding style: the while True case

2018-07-04 Thread MRAB
On 2018-07-04 23:51, Victor Stinner wrote: [snip] (C) while True: chunk = self.raw.read() if chunk in empty_values: nodata_val = chunk break ... "nodata_val = chunk" cannot be put into the "chunk := self.raw.read()" assignment expression combined with a test.

Re: [Python-Dev] Unicode 11.0.0 released

2018-06-07 Thread MRAB
On 2018-06-07 08:40, Ned Deily wrote: On Jun 6, 2018, at 00:22, Benjamin Peterson wrote: > On Tue, Jun 5, 2018, at 12:17, MRAB wrote: >> Unicode 11.0.0 has been released. Will Python 3.7 be updated to it, or >> is it too late? > > https://github.com/python/cpython/pull

[Python-Dev] Unicode 11.0.0 released

2018-06-05 Thread MRAB
Unicode 11.0.0 has been released. Will Python 3.7 be updated to it, or is it too late? ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe:

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

2018-05-07 Thread MRAB
On 2018-05-07 19:49, Craig Rodrigues wrote: [snip] Would it be reasonable to request a 10 year moratorium on making changes to the core Python language, and for the next 10 years only focus on things that do not require core language changes, such as improving/bugfixing existing libraries,

Re: [Python-Dev] Drop/deprecate Tkinter?

2018-05-03 Thread MRAB
On 2018-05-03 13:24, Steve Holden wrote: On Thu, May 3, 2018 at 12:12 AM, Ivan Pozdeev via Python-Dev > wrote: On 03.05.2018 1:01, Antoine Pitrou wrote: On Wed, 2 May 2018 22:54:04 +0100 Paul Moore

Re: [Python-Dev] Drop/deprecate Tkinter?

2018-05-02 Thread MRAB
On 2018-05-02 22:56, Josh Stephens wrote: Hello list,   If I may voice my opinion I would like to say that I just built an application using Tkinter using python3. I used it because it was included in python by default and I didn't have to using something like PyQT or any other framework that

Re: [Python-Dev] assignment expressions: an alternative proposal

2018-04-24 Thread MRAB
On 2018-04-24 23:32, Cameron Simpson wrote: On 24Apr2018 08:51, Ethan Furman wrote: When I compare to variables from outer scopes they *usually* are on the *right* side of '=='. You mean something like if 2 == x: ? I never write code like that, and I haven't seen it,

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

2018-04-24 Thread MRAB
real improvement. In every case I thought it _might_ help, it turned >> out that it really didn't unless Python _also_ grew an analog to C's >> "comma operator" (take only the last result from a sequence of >> expressions). I'll also note that I asked if anyone else

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

2018-04-20 Thread MRAB
On 2018-04-20 22:33, Tim Peters wrote: [snip] And I'll take this opportunity to repeat the key point for me: I tried hard, but never found a single case based on staring at real code where allowing _fancier_ (than "plain name") targets would be a real improvement. In every case I thought it

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

2018-04-18 Thread MRAB
On 2018-04-17 22:44, Greg Ewing wrote: Paul Moore wrote: the next question will likely be "so why does = exist at all?" And if we decide to make ':=' the official assigment operator and deprectate '=', the next question will be "Why do we have '==' instead of '='?" Some languages use '=' for

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

2018-04-17 Thread MRAB
On 2018-04-17 22:53, Terry Reedy wrote: On 4/17/2018 3:46 AM, Chris Angelico wrote: [snip] Augmented assignment is not supported in expression form:: >>> x +:= 1 File "", line 1 x +:= 1 ^ SyntaxError: invalid syntax I would have expected :+=, but

Re: [Python-Dev] in

2018-04-03 Thread MRAB
On 2018-04-04 00:34, Ethan Furman wrote: This behavior was recently brought to my attention [1]: --> 1 in 'hello' Traceback (most recent call last): File "", line 1, in TypeError: 'in ' requires string as left operand, not int However, in any other collection (set, dict, list, tuple,

Re: [Python-Dev] Python version numbers

2018-04-03 Thread MRAB
On 2018-04-03 18:09, Paul G wrote: On 04/03/2018 12:36 PM, Brett Cannon wrote: On Tue, 3 Apr 2018 at 07:39 Paul G wrote: Paul's point is that he knows e.g. code working in 3.6.0 will work when he upgrades to 3.6.5, and if his code is warning-free and works with all

Re: [Python-Dev] IDLE colorizer

2018-04-02 Thread MRAB
called "colorizer.py" in a folder called "idlelib". On Sun, Apr 1, 2018 at 6:49 PM, MRAB <pyt...@mrabarnett.plus.com <mailto:pyt...@mrabarnett.plus.com>> wrote: A thread on python-ideas is talking about the prefixes of string literals, and the regex us

[Python-Dev] IDLE colorizer

2018-04-01 Thread MRAB
A thread on python-ideas is talking about the prefixes of string literals, and the regex used in IDLE. Line 25 of Lib\idlelib\colorizer.py is: stringprefix = r"(?i:\br|u|f|fr|rf|b|br|rb)?" which looks slightly wrong to me. The \b will apply only to the first choice. Shouldn't it be more

Re: [Python-Dev] ttk.Treeview.insert() does not allow to insert item with iid=0

2018-03-16 Thread MRAB
On 2018-03-16 20:22, Terry Reedy wrote: On 3/16/2018 6:54 AM, Игорь Яковченко wrote: [snip] There is no item with such iid. This item has autogenerated iid just like it's not specified. I investigated problem and found that in ttk.py, Treeview.insert(... iid=None, ...) in method's body has a

Re: [Python-Dev] pycapsule:PyObject * is NULL pointer

2018-02-20 Thread MRAB
On 2018-02-21 02:28, 赵亚 wrote: This "python-dev" list is for development of the Python language itself. I think that this message should instead have been sent to "python-list". i have question:call,c-->python-->c. 1.the c pointer void* abc="123" by pycapsule in the c code. .. void*

Re: [Python-Dev] Why is Python for Windows compiled with MSVC?

2018-01-31 Thread MRAB
On 2018-01-31 19:07, Ray Donnelly wrote: On Wed, Jan 31, 2018 at 3:04 PM, Oleg Sivokon wrote: Hello list. I'll give some background before asking my question in more detail. [snip] Now all I had to do was to re-create my success on Windows (most of the employees in my

Re: [Python-Dev] Bug report in audioop module.

2018-01-10 Thread MRAB
On 2018-01-10 20:37, Moses Egypt wrote: I was told to post this here when I asked what to do on the python reddit. This is the issue: https://bugs.python.org/issue32004 It has received no response since I posted it two months ago, so I figured I didn't fill something out correctly to get it

Re: [Python-Dev] (no subject)

2017-12-26 Thread MRAB
On 2017-12-26 07:01, Yogev Hendel wrote: I don't know if this is the right place to put this, but I've found the following lines of code results in an incredibly long processing time. Perhaps it might be of use to someone. /import re/ /pat = re.compile('^/?(?:\\w+)/(?:[%\\w-]+/?)+/?$')/

Re: [Python-Dev] Is static typing still optional?

2017-12-22 Thread MRAB
On 2017-12-22 21:02, Mike Miller wrote: On 2017-12-22 12:15, Chris Barker wrote: Would it be crazy to bring typing.Any into the builtin namespace? @dataclass:     a: Any     b: Any = 34     c: int = 0 That reads pretty well to me > And having Any available in the built in namespace

Re: [Python-Dev] is typing optional in dataclasses?

2017-12-21 Thread MRAB
On 2017-12-22 00:19, Gregory P. Smith wrote: (subject for this sub-thread updated) On Thu, Dec 21, 2017 at 4:08 PM Chris Barker > wrote: On Thu, Dec 21, 2017 at 3:36 PM, Gregory P. Smith >

Re: [Python-Dev] Is static typing still optional?

2017-12-21 Thread MRAB
On 2017-12-21 22:45, Chris Barker wrote: On Thu, Dec 21, 2017 at 11:55 AM, Terry Reedy > wrote: I think the understanding problem with this feature arises from two factors: using annotations to define possibly un-initialized slots is

Re: [Python-Dev] Accepting PEP 560 -- Core support for typing module and generic types

2017-12-15 Thread MRAB
On 2017-12-15 16:36, Antoine Pitrou wrote: On Fri, 15 Dec 2017 14:05:46 +0200 Serhiy Storchaka wrote: 15.12.17 04:00, Guido van Rossum пише: > In the light of Antoine's and Stephan's feedback I think this can be > reconsidered -- while I want to take a cautious stance

Re: [Python-Dev] Zero-width matching in regexes

2017-12-05 Thread MRAB
On 2017-12-05 20:26, Terry Reedy wrote: On 12/4/2017 6:21 PM, MRAB wrote: I've finally come to a conclusion as to what the "correct" behaviour of zero-width matches should be: """always return the first match, but never a zero-width match that is joined to a

[Python-Dev] Zero-width matching in regexes

2017-12-04 Thread MRAB
I've finally come to a conclusion as to what the "correct" behaviour of zero-width matches should be: """always return the first match, but never a zero-width match that is joined to a previous zero-width match""". If it's about to return a zero-width match that's joined to a previous

Re: [Python-Dev] What's the status of PEP 505: None-aware operators?

2017-12-01 Thread MRAB
On 2017-12-01 13:24, Random832 wrote: On Fri, Dec 1, 2017, at 05:31, Steven D'Aprano wrote: I'm more confused than ever. You seem to be arguing that Python functions CAN short-circuit their arguments and avoid evaluating them. Is that the case? If this is merely about when the name

Re: [Python-Dev] Regular expressions: splitting on zero-width patterns

2017-11-28 Thread MRAB
On 2017-11-28 22:27, Guido van Rossum wrote: On Tue, Nov 28, 2017 at 2:23 PM, MRAB <pyt...@mrabarnett.plus.com <mailto:pyt...@mrabarnett.plus.com>> wrote: On 2017-11-28 20:04, Serhiy Storchaka wrote: The two largest problems in the re module are splitting on

Re: [Python-Dev] Regular expressions: splitting on zero-width patterns

2017-11-28 Thread MRAB
On 2017-11-28 20:04, Serhiy Storchaka wrote: The two largest problems in the re module are splitting on zero-width patterns and complete and correct support of the Unicode standard. These problems are solved in regex. regex has many other features, but they are less important. I want to tell

Re: [Python-Dev] Regular expressions: splitting on zero-width patterns

2017-11-28 Thread MRAB
On 2017-11-28 20:04, Serhiy Storchaka wrote: The two largest problems in the re module are splitting on zero-width patterns and complete and correct support of the Unicode standard. These problems are solved in regex. regex has many other features, but they are less important. I want to tell

Re: [Python-Dev] Tricky way of of creating a generator via a comprehension expression

2017-11-24 Thread MRAB
On 2017-11-25 02:21, Chris Jerdonek wrote: On Fri, Nov 24, 2017 at 5:06 PM, Nathaniel Smith wrote: On Fri, Nov 24, 2017 at 4:22 PM, Guido van Rossum wrote: The more I hear about this topic, the more I think that `await`, `yield` and `yield from` should all

Re: [Python-Dev] Proposal: go back to enabling DeprecationWarning by default

2017-11-07 Thread MRAB
On 2017-11-07 14:17, Philipp A. wrote: Nick Coghlan > schrieb am Di., 7. Nov. 2017 um 14:57 Uhr: Users of applications written in Python are not python-dev's users: they're the users of those applications, and hence the quality of that

Re: [Python-Dev] \G (match last position) regex operator non-existant in python?

2017-10-29 Thread MRAB
On 2017-10-29 12:27, Serhiy Storchaka wrote: 27.10.17 18:35, Guido van Rossum пише: The "why" question is not very interesting -- it probably wasn't in PCRE and nobody was familiar with it when we moved off PCRE (maybe it wasn't even in Perl at the time -- it was ~15 years ago). I didn't

Re: [Python-Dev] \G (match last position) regex operator non-existant in python?

2017-10-28 Thread MRAB
On 2017-10-29 00:48, Steven D'Aprano wrote: On Sun, Oct 29, 2017 at 12:31:01AM +0100, MRAB wrote: Not that I'm planning on making any further additions, just bug fixes and updates to follow the Unicode updates. I think I've crammed enough into it already. There's only so much you can do

Re: [Python-Dev] \G (match last position) regex operator non-existant in python?

2017-10-28 Thread MRAB
On 2017-10-28 22:05, Guido van Rossum wrote: On Sat, Oct 28, 2017 at 12:09 AM, Nick Coghlan > wrote: On 28 October 2017 at 01:57, Guido van Rossum > wrote: Oh. Yes, that is being

Re: [Python-Dev] how/where is open() implemented ?

2017-10-05 Thread MRAB
On 2017-10-06 03:19, Yubin Ruan wrote: Hi, I am looking for the implementation of open() in the src, but so far I am not able to do this. From my observation, the implementation of open() in python2/3 does not employ the open(2) system call. However without open(2) how can one possibly obtain

Re: [Python-Dev] PEP 554 v3 (new interpreters module)

2017-09-23 Thread MRAB
On 2017-09-23 10:45, Antoine Pitrou wrote: Hi Eric, On Fri, 22 Sep 2017 19:09:01 -0600 Eric Snow wrote: Please elaborate. I'm interested in understanding what you mean here. Do you have some subinterpreter-based concurrency improvements in mind? What aspect of

Re: [Python-Dev] PEP 559 - built-in noop()

2017-09-09 Thread MRAB
On 2017-09-09 19:46, Barry Warsaw wrote: I couldn’t resist one more PEP from the Core sprint. I won’t reveal where or how this one came to me. -Barry PEP: 559 Title: Built-in noop() Author: Barry Warsaw Status: Draft Type: Standards Track Content-Type: text/x-rst Created:

Re: [Python-Dev] PEP 550 v3 naming

2017-08-22 Thread MRAB
On 2017-08-23 00:12, Greg Ewing wrote: Guido van Rossum wrote: Perhaps the latter can be shortened to just ContextStack (since the Foo part can probably be guessed from context. :-) -0.9, if I saw something called ContextStack turn up in a traceback I wouldn't necessarily jump to the

Re: [Python-Dev] bugs.python.org - outage 08/09/17 until 8:00pm PST

2017-08-09 Thread MRAB
On 2017-08-09 23:18, Mark Mangoba wrote: Dear Colleagues, I was just informed from our hosting provider for bugs.python.org , Hetzner Online - that the server is currently being migrated to a new data center. Unfortunately I was not informed ahead of time and working

Re: [Python-Dev] for...else

2017-07-28 Thread MRAB
e 27/07/2017 à 21:19, MRAB a écrit : On 2017-07-27 03:34, Mike Miller wrote: On 2017-07-26 16:36, MRAB wrote: "nobreak" would introduce a new keyword, but "not break" wouldn't. Whenever I've used the for-else, I've put a # no-break right next to it, to remind myself as

Re: [Python-Dev] for...else

2017-07-27 Thread MRAB
On 2017-07-27 03:34, Mike Miller wrote: On 2017-07-26 16:36, MRAB wrote: "nobreak" would introduce a new keyword, but "not break" wouldn't. Whenever I've used the for-else, I've put a # no-break right next to it, to remind myself as much as anyone else. for...: no

Re: [Python-Dev] for...else

2017-07-26 Thread MRAB
On 2017-07-27 01:07, Koos Zevenhoven wrote: On Jul 27, 2017 02:38, "MRAB" <pyt...@mrabarnett.plus.com <mailto:pyt...@mrabarnett.plus.com>> wrote: On 2017-07-26 23:55, Koos Zevenhoven wrote: ​IMO, for item in sequence: # block n

Re: [Python-Dev] for...else

2017-07-26 Thread MRAB
On 2017-07-26 23:55, Koos Zevenhoven wrote: On Mon, Jul 24, 2017 at 7:14 PM, Steven D'Aprano >wrote: Hello Kiuhnm, and welcome. On Mon, Jul 24, 2017 at 05:35:03PM +0200, Kiuhnm via Python-Dev wrote: > Hello, > > I think that

Re: [Python-Dev] Impact of Namedtuple on startup time

2017-07-17 Thread MRAB
On 2017-07-17 21:46, MRAB wrote: On 2017-07-17 21:31, Giampaolo Rodola' wrote: I completely agree. I love namedtuples but I've never been too happy about the additional overhead vs. plain tuples (both for creation and attribute access times), to the point that I explicitly avoid to use them

Re: [Python-Dev] Impact of Namedtuple on startup time

2017-07-17 Thread MRAB
On 2017-07-17 21:31, Giampaolo Rodola' wrote: I completely agree. I love namedtuples but I've never been too happy about the additional overhead vs. plain tuples (both for creation and attribute access times), to the point that I explicitly avoid to use them in certain circumstances (e.g. a

Re: [Python-Dev] Pure pickle bechmark.

2017-07-09 Thread MRAB
On 2017-07-09 15:08, Bhavishya wrote: Hello, 1).I was going through the code of *python pickle* to search any optimization possibility.But the only thing that I found very alarming was again the import time(I tried with lazy-import but it didn't helped much.) I found py3 to be ~45 times

Re: [Python-Dev] PEP 7 and braces { .... } on if

2017-06-05 Thread MRAB
On 2017-06-05 13:00, Skip Montanaro wrote: On Mon, Jun 5, 2017 at 12:41 AM, Serhiy Storchaka wrote: Barry and Victor prefer moving a brace on a new line in all multiline conditional cases. I think that it should be done only when the condition continuation lines and the

Re: [Python-Dev] 2017 Python Language Summit coverage

2017-05-25 Thread MRAB
On 2017-05-25 22:16, Gregory P. Smith wrote: Thanks Jake! I'm laughing at not being in the photo. That must've happened soon after I left the room as I disappeared a tad early. I'll pretend I'm hiding behind Brett or Thomas. ;) > -gps > Or someone could Photoshop you in. :-) On Thu,

Re: [Python-Dev] Exact date of Python 2 EOL?

2017-03-23 Thread MRAB
On 2017-03-23 16:37, Brian Curtin wrote: On Thu, Mar 23, 2017 at 12:19 PM, Barry Warsaw wrote: On Mar 23, 2017, at 09:41 AM, Victor Stinner wrote: Can we pick an official date? Benjamin should pick the date and update PEP 373. Not to start a bikeshed (calendarshed?),

Re: [Python-Dev] __del__ is not called after creating a new reference

2017-03-20 Thread MRAB
On 2017-03-20 20:23, Antoine Pitrou wrote: Hello Oleg, On Mon, 20 Mar 2017 18:28:29 +0100 Oleg Nesterov wrote: I started to learn python a few days ago and I am trying to understand what __del__() actually does. https://docs.python.org/3/reference/datamodel.html says:

Re: [Python-Dev] Translated Python documentation

2017-02-24 Thread MRAB
On 2017-02-24 15:10, Steven D'Aprano wrote: On Fri, Feb 24, 2017 at 06:01:59AM -0500, tritium-l...@sdamon.com wrote: My gut splits the difference on this issue; I suggest an approach to meet in the middle – a version of the docs written in simplified English (Not quite Up Goer Five simplified,

Re: [Python-Dev] Update on labels to be used on GitHub

2017-02-14 Thread MRAB
On 2017-02-14 17:58, Victor Stinner wrote: 2017-02-14 18:43 GMT+01:00 Zachary Ware : To propose another color for the bikeshed, what about having labels for each branch along with "needs backport" and "cherry-pick" labels? Oh right, labels have colors. I propose

Re: [Python-Dev] re performance

2017-01-27 Thread MRAB
On 2017-01-27 22:15, Michael Felt wrote: On 27/01/2017 22:24, MRAB wrote: > I'm not bothered about it. It's quite a bit bigger than the re module, > and, anyway, keeping it as a third-party module gives me more freedom > to make updates, which are available for a range of Python ver

Re: [Python-Dev] re performance

2017-01-27 Thread MRAB
On 2017-01-27 17:03, Łukasz Langa wrote: On Jan 26, 2017, at 5:16 PM, MRAB <pyt...@mrabarnett.plus.com <mailto:pyt...@mrabarnett.plus.com>> wrote: So, it seems as if regex already uses a better algorithm although I couldn't find any reference to any regex theoretical framework l

Re: [Python-Dev] re performance

2017-01-26 Thread MRAB
On 2017-01-26 21:46, Sven R. Kunze wrote: On 26.01.2017 22:33, Vlastimil Brom wrote: Hi, I can't speak about the details of mrab's implementation, but using regex, I get the resulting match instantly: [...] Nice! I focused on the stdlib re module as this is mainly used by other frameworks

Re: [Python-Dev] re performance

2017-01-26 Thread MRAB
On 2017-01-26 21:13, Sven R. Kunze wrote: Hi folks, I recently refreshed regular expressions theoretical basics *indulging in reminiscences* So, I read https://swtch.com/~rsc/regexp/regexp1.html However, reaching the chart in the lower third of the article, I saw Python 2.4 measured against a

Re: [Python-Dev] Implementation difference of audioop.lin2lin in Python2 and Python3

2016-12-13 Thread MRAB
On 2016-12-13 11:31, KH Luke Kim wrote: Hello, recently there had been some issues in audioread and librosa that 3-byte samples can be loaded in Python 3 but 2. The documentation says that the audioop.lin2lin function in Python 3 support 1-, 2-, 3-, 4-byte samples but only 1-, 2-, 4-byte

Re: [Python-Dev] PyWeakref_GetObject() borrows its reference from... whom?

2016-10-10 Thread MRAB
On 2016-10-10 22:14, Larry Hastings wrote: On 10/10/2016 09:36 PM, Chris Angelico wrote: Hmm. Here's a naughty, and maybe dangerous, theory. Obtain a "memory deallocation lock". While it is held (by any thread - it's a guard, more than a lock), Py_DECREF will not actually deallocate memory -

Re: [Python-Dev] PyWeakref_GetObject() borrows its reference from... whom?

2016-10-10 Thread MRAB
On 2016-10-10 20:36, Chris Angelico wrote: On Tue, Oct 11, 2016 at 5:24 AM, Random832 <random...@fastmail.com> wrote: On Mon, Oct 10, 2016, at 14:04, MRAB wrote: Instead of locking the object, could we keep the GIL, but have it normally released? A thread could then still call a fu

Re: [Python-Dev] PyWeakref_GetObject() borrows its reference from... whom?

2016-10-10 Thread MRAB
On 2016-10-10 18:50, Nathaniel Smith wrote: On Mon, Oct 10, 2016 at 10:03 AM, Paul Moore <p.f.mo...@gmail.com> wrote: > On 10 October 2016 at 17:49, MRAB <pyt...@mrabarnett.plus.com> wrote: >> If you lookup something in a dict, it'll be a borrowed reference. >>

Re: [Python-Dev] PyWeakref_GetObject() borrows its reference from... whom?

2016-10-10 Thread MRAB
On 2016-10-10 10:45, Chris Angelico wrote: On Mon, Oct 10, 2016 at 8:35 PM, Larry Hastings wrote: Huh? In all other circumstances, a "borrowed" reference is exactly that: X has a reference, and you are relying on X's reference to keep the object alive. Borrowing from a

Re: [Python-Dev] TextIO seek and tell cookies

2016-09-25 Thread MRAB
On 2016-09-26 00:21, Ben Leslie wrote: Hi all, I recently shot myself in the foot by assuming that TextIO.tell returned integers rather than opaque cookies. Specifically I was adding an offset to the value returned by TextIO.tell. In retrospect this doesn't make sense/ Now, I don't want to

Re: [Python-Dev] Python 3.6 dict becomes compact and gets a private version; and keywords become ordered

2016-09-13 Thread MRAB
On 2016-09-14 00:42, Greg Ewing wrote: MRAB wrote: On 2016-09-13 07:57, Mark Lawrence via Python-Dev wrote: "tables the idea" has the US meaning of close it down, not the UK meaning of open it up? :) A better phrase would've been "shelves the idea". There's even a mod

Re: [Python-Dev] Python 3.6 dict becomes compact and gets a private version; and keywords become ordered

2016-09-13 Thread MRAB
On 2016-09-13 11:44, Nick Coghlan wrote: On 13 September 2016 at 08:25, Gregory P. Smith wrote: At this point I think coding up an example patch against beta1 offering a choice of disordered iteration capability that does not increase memory or iteration overhead in any

Re: [Python-Dev] Python 3.6 dict becomes compact and gets a private version; and keywords become ordered

2016-09-13 Thread MRAB
On 2016-09-13 07:57, Mark Lawrence via Python-Dev wrote: On 12/09/2016 23:25, Gregory P. Smith wrote: [snip] The problem is... I don't know how to express this as an API. Which sinks my whole though process and tables the idea. "tables the idea" has the US meaning of close it down, not

<    1   2   3   4   5   6   >