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

2014-06-26 Thread MRAB
On 2014-06-26 23:59, Ben Hoyt wrote: Hi Python dev folks, I've written a PEP proposing a specific os.scandir() API for a directory iterator that returns the stat-like info from the OS, the main advantage of which is to speed up os.walk() and similar operations between 4-20x, depending on your OS

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

2014-06-26 Thread MRAB
On 2014-06-27 02:37, Ben Hoyt wrote: I don't mind iterdir() and would take it :-), but I'll just say why I chose the name scandir() -- though it wasn't my suggestion originally: iterdir() sounds like just an iterator version of listdir(), kinda like keys() and iterkeys() in Python 2. Whereas in

[Python-Dev] LZO bug

2014-06-27 Thread MRAB
Is this something that we need to worry about? Raising Lazarus - The 20 Year Old Bug that Went to Mars http://blog.securitymouse.com/2014/06/raising-lazarus-20-year-old-bug-that.html ___ Python-Dev mailing list Python-Dev@python.org https://mail.python

Re: [Python-Dev] == on object tests identity in 3.x

2014-07-08 Thread MRAB
On 2014-07-08 17:57, Steven D'Aprano wrote: [snip] In particular, reflexivity for NANs was dropped for a number of reasons, some stronger than others: - One of the weaker reasons for NAN non-reflexivity is that it preserved the identity x == y <=> x - y == 0. Although that is the cornerstone

Re: [Python-Dev] Updates to PEP 471, the os.scandir() proposal

2014-07-09 Thread MRAB
On 2014-07-09 23:50, Ethan Furman wrote: On 07/09/2014 02:33 PM, Ben Hoyt wrote: On a system which did not supply is_dir automatically I would write that as: for entry in os.scandir(path): if ignore_entry(entry.name): continue if os.path.isdir(entry.full_name):

Re: [Python-Dev] Another case for frozendict

2014-07-15 Thread MRAB
On 2014-07-16 00:48, Russell E. Owen wrote: In article , Chris Angelico wrote: On Mon, Jul 14, 2014 at 12:04 AM, Jason R. Coombs wrote: > I can achieve what I need by constructing a set on the ‘items’ of the dict. > set(tuple(doc.items()) for doc in res) > > {(('n', 1), ('err', No

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

2014-08-02 Thread MRAB
On 2014-08-02 16:27, Steven D'Aprano wrote: On Sat, Aug 02, 2014 at 10:52:07AM -0400, Alexander Belopolsky wrote: On Sat, Aug 2, 2014 at 3:39 AM, Steven D'Aprano wrote: > String concatenation with + is an attractive > nuisance for many people, including some who actually know better but > neve

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

2014-08-26 Thread MRAB
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, replacement='\uFFFD') How about: r

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

2014-08-28 Thread MRAB
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] https://docs.python.org/3/using/index.html not linking correctly

2014-10-20 Thread MRAB
On 2014-10-21 00:09, Eli Bendersky wrote: On Mon, Oct 20, 2014 at 1:01 PM, Terry Reedy mailto:tjre...@udel.edu>> wrote: If I go to https://docs.python.org/3/using/index.html and click on any of the TOC entries, I get 'connecting' indefinitely. This problem seems unique to this fil

Re: [Python-Dev] https://docs.python.org/3/using/index.html not linking correctly

2014-10-20 Thread MRAB
On 2014-10-21 00:38, Oleg Broytman wrote: On Tue, Oct 21, 2014 at 12:29:45AM +0100, MRAB wrote: On 2014-10-21 00:09, Eli Bendersky wrote: > >On Mon, Oct 20, 2014 at 1:01 PM, Terry Reedy <mailto:tjre...@udel.edu>> wrote: > >If I go to https://docs.python.org/3/using/in

Re: [Python-Dev] https://docs.python.org/3/using/index.html not linking correctly

2014-10-20 Thread MRAB
On 2014-10-21 02:17, MRAB wrote: On 2014-10-21 00:38, Oleg Broytman wrote: On Tue, Oct 21, 2014 at 12:29:45AM +0100, MRAB wrote: On 2014-10-21 00:09, Eli Bendersky wrote: > >On Mon, Oct 20, 2014 at 1:01 PM, Terry Reedy <mailto:tjre...@udel.edu>> wrote: > >

Re: [Python-Dev] https://docs.python.org/3/using/index.html not linking correctly

2014-10-21 Thread MRAB
On 2014-10-21 01:39, Terry Reedy wrote: On 10/20/2014 7:29 PM, MRAB wrote: On 2014-10-21 00:09, Eli Bendersky wrote: On Mon, Oct 20, 2014 at 1:01 PM, Terry Reedy mailto:tjre...@udel.edu>> wrote: If I go to https://docs.python.org/3/using/index.html and click on any of t

Re: [Python-Dev] Real-world use of Counter

2014-11-05 Thread MRAB
On 2014-11-05 16:33, Ethan Furman wrote: I'm looking for real-world uses of collections.Counter, specifically to see if anyone has been surprised by, or had to spend extra-time debugging, issues with the in-place operators. If sufficient and/or compelling use-cases are uncovered, the behavior o

Re: [Python-Dev] Static checker for common Python programming errors

2014-11-17 Thread MRAB
On 2014-11-18 01:21, Terry Reedy wrote: On 11/17/2014 9:49 AM, Stefan Bucur wrote: I'm developing a Python static analysis tool that flags common programming errors in Python programs. The tool is meant to complement other tools like Pylint (which perform checks at lexical and syntactic level) b

Re: [Python-Dev] PEP 479: Change StopIteration handling inside generators

2014-11-19 Thread MRAB
On 2014-11-19 20:10, Guido van Rossum wrote: There's a new PEP proposing to change how to treat StopIteration bubbling up out of a generator frame (not caused by a return from the frame). The proposal is to replace such a StopIteration with a RuntimeError (chained to the original StopIteration),

Re: [Python-Dev] datetime nanosecond support (ctd?)

2014-12-11 Thread MRAB
On 2014-12-11 18:33, Skip Montanaro wrote: On Thu, Dec 11, 2014 at 11:58 AM, Matthieu Bec wrote: ...or keep using "%f" if acceptable... That might be a problem. While it will probably work most of the time, there are likely to be situations where the caller assumes it generates a six-digit st

Re: [Python-Dev] Any grammar experts?

2015-01-26 Thread MRAB
On 2015-01-26 19:39, Petr Viktorin wrote: On Mon, Jan 26, 2015 at 8:29 PM, Ethan Furman wrote: On 01/26/2015 11:24 AM, Barry Warsaw wrote: On Jan 26, 2015, at 10:55 AM, Ethan Furman wrote: In the your example from_env = {'a': 12} from_config = {'a': 13} f(**from_env, **from_config) I w

Re: [Python-Dev] also

2015-01-28 Thread MRAB
On 2015-01-28 14:39, Alan Armour wrote: if you can do this a chemical physics and element physics like everything from melting points to how much heat you need to add two chemicals together and physics like aerodynamics, space dynamics, and hydrodynamics etcetera for propellers and motors a

Re: [Python-Dev] subclassing builtin data structures

2015-02-12 Thread MRAB
On 2015-02-13 00:55, Guido van Rossum wrote: On Thu, Feb 12, 2015 at 4:36 PM, Ethan Furman mailto:et...@stoneleaf.us>> wrote: I suspect the last big hurdle to making built-in data structures nicely subclassable is the insistence of such types to return new instances as the base class

Re: [Python-Dev] TypeError messages

2015-02-19 Thread MRAB
On 2015-02-19 22:50, Serhiy Storchaka wrote:> Different patterns for TypeError messages are used in the stdlib: > > expected X, Y found > expected X, found Y > expected X, but Y found > expected X instance, Y found > X expected, not Y > expect X, not Y > n

Re: [Python-Dev] TypeError messages

2015-02-21 Thread MRAB
On 2015-02-21 17:14, Antoine Pitrou wrote: On Fri, 20 Feb 2015 14:05:11 + Brett Cannon wrote: On Thu Feb 19 2015 at 5:52:07 PM Serhiy Storchaka wrote: > Different patterns for TypeError messages are used in the stdlib: > > expected X, Y found > expected X, found Y > expecte

Re: [Python-Dev] some minor questions about pep8

2015-03-21 Thread MRAB
On 2015-03-21 21:00, Donald Stufft wrote: On Mar 21, 2015, at 4:53 PM, Barry Warsaw wrote: On Mar 20, 2015, at 08:53 PM, Guido van Rossum wrote: FWIW, I think __version__, __author__ etc. were bad ideas. Almost nobody manages these correctly. Note that the PEP 8 section starts with less tha

Re: [Python-Dev] Aware datetime from naive local time Was: Status on PEP-431 Timezones

2015-04-13 Thread MRAB
On 2015-04-13 20:14, Alexander Belopolsky wrote: On Mon, Apr 13, 2015 at 2:05 PM, Chris Barker mailto:chris.bar...@noaa.gov>> wrote: However, different UTC times may map to the same wall time and some expressible wall times are not results of a map of any UTC time.

Re: [Python-Dev] async/await in Python; v2

2015-04-23 Thread MRAB
On 2015-04-23 18:51, Barry Warsaw wrote: On Apr 21, 2015, at 01:26 PM, Yury Selivanov wrote: The updated version of the PEP should be available shortly at https://www.python.org/dev/peps/pep-0492 and is also pasted in this email. There's a lot to like about PEP 492. I only want to mildly bik

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: 2017-09-08 Python-V

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 CSP is the PEP following too

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] \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 mailto:gu...@python.org>> wrote: Oh. Yes, that is being discussed about once a year two. It seems Mat

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

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 unde

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 mailto:ncogh...@gmail.com>> 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 experience is up to t

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 be banned from occurring in all comp

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 the

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 the

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 <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 zero-width patterns and

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 "function"

[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 zero-wid

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 prev

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 about resource > consump

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 non-obvious; a new use of

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 mailto:g...@krypto.org>> wrote:  But we already have ... which d

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] (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-]+/?)+/?$')/ /pat.

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 pu

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 company use Windows)

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* lpCon

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

[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] IDLE colorizer

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

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 __future__ statements i

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, etc),

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 agre

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-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 _m

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 i

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, either. Just to thi

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 w

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 mailto:python-dev@python.org>> wrote: On 03.05.2018 1:01, Antoine Pitrou wrote: On Wed, 2 May 2018 22:54:04 +0100 Paul Moore mailto:p.f.mo...@gmail.com>> wrote:

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,

[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: https://mail.python.org/mailman/options/python-dev

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

Re: [Python-Dev] segfaults due to hash randomization in C OrderedDict

2015-05-21 Thread MRAB
On 2015-05-21 15:55, Eric Snow wrote: (see http://bugs.python.org/issue16991) I an working on resolving an intermittent segfault that my C OrderedDict patch introduces. The failure happens in test_configparser (RawConfigParser uses OrderedDict internally), but only sporadically. However, Ned p

Re: [Python-Dev] segfaults due to hash randomization in C OrderedDict

2015-05-21 Thread MRAB
On 2015-05-21 22:52, Eric Snow wrote: > Good catch. Unfortunately, sticking "keys = ((PyDictObject > *)od)->ma_keys;" right after "hash = ..." did not make a difference. > I still get the same segfault. So, does it change sometimes? > > On Thu, May 21, 2

Re: [Python-Dev] segfaults due to hash randomization in C OrderedDict

2015-05-21 Thread MRAB
On 2015-05-21 23:17, Eric Snow wrote: > On Thu, May 21, 2015 at 4:06 PM, MRAB wrote: > > On 2015-05-21 22:52, Eric Snow wrote: > >> Good catch. Unfortunately, sticking "keys = ((PyDictObject > >> *)od)->ma_keys;" right after "hash = ..." di

Re: [Python-Dev] segfaults due to hash randomization in C OrderedDict

2015-05-21 Thread MRAB
On 2015-05-22 00:22, Eric Snow wrote: On Thu, May 21, 2015 at 4:41 PM, MRAB wrote: > On 2015-05-21 23:17, Eric Snow wrote: >> The segfault is consistent if I use the same seed (e.g. 7): >> >> PYTHONHASHSEED=7 ./python -m test.regrtest -m test_basic >> test_co

Re: [Python-Dev] segfaults due to hash randomization in C OrderedDict

2015-05-21 Thread MRAB
On 2015-05-22 01:12, Eric Snow wrote: On Thu, May 21, 2015 at 5:55 PM, MRAB wrote: > I'm not looking at the use of "PyTuple_Pack". As I understand it, > "PyTuple_Pack" borrows the > references of the objects passed, and when the tuple itself is DECREFed,

[Python-Dev] Unable to build regex module against Python 3.5 32-bit

2015-05-25 Thread MRAB
As the subject says, I've been unable to build the regex module against Python 3.5b1 for 32-bit. MingGW says: skipping incompatible .../libpython35.a when searching for -lpython35 It builds without a problem against Python 3.5 for 64-bit. Any ideas? Should I just wait until beta 2?

Re: [Python-Dev] Unable to build regex module against Python 3.5 32-bit

2015-05-25 Thread MRAB
All of the other versions build without a problem: Python 2.5-2.7 and Python 3.1-3.4, both 32-bit and 64-bit, and now Python 3.5 64-bit. That's 15 building and 1 failing! > On May 25, 2015 3:06:01 PM CDT, MRAB wrote: > > As the subject says, I've been unable to build the re

Re: [Python-Dev] Unable to build regex module against Python 3.5 32-bit

2015-05-25 Thread MRAB
On 2015-05-25 22:59, Paul Moore wrote: > On 25 May 2015 at 21:06, MRAB wrote: > > As the subject says, I've been unable to build the regex module against > > Python 3.5b1 for 32-bit. MingGW says: > > > > skipping incompatible .../libpython35.a when searc

Re: [Python-Dev] Unable to build regex module against Python 3.5 32-bit

2015-05-26 Thread MRAB
On 2015-05-26 14:24, Paul Moore wrote: > On 26 May 2015 at 13:55, Steve Dower wrote: > > The builds I am responsible for include it because someone reported an issue > > and was persistent and helpful enough that I fixed it for them. > > > > That said, until MinGW agrees on a stable branch/vers

Re: [Python-Dev] Unable to build regex module against Python 3.5 32-bit

2015-05-26 Thread MRAB
On 2015-05-26 18:27, Paul Moore wrote: > On 26 May 2015 at 18:23, MRAB wrote: > > I made libpython35.a like I did for the others and it's all working now. All > > the tests pass. :-) > > Cool. How did you make libpython35.a? Sounds like there is some > difference

Re: [Python-Dev] Unable to build regex module against Python 3.5 32-bit

2015-06-04 Thread MRAB
On 2015-05-27 09:25, Paul Moore wrote: On 27 May 2015 at 09:10, Nick Coghlan wrote: The old distutils docs aren't gone, the top level links just moved to the distutils package docs: https://docs.python.org/3/library/distutils.html I kept them (with the same deep link URLs) because I know there

Re: [Python-Dev] Unable to build regex module against Python 3.5 32-bit

2015-06-04 Thread MRAB
On 2015-06-05 01:37, MRAB wrote: On 2015-05-27 09:25, Paul Moore wrote: On 27 May 2015 at 09:10, Nick Coghlan wrote: The old distutils docs aren't gone, the top level links just moved to the distutils package docs: https://docs.python.org/3/library/distutils.html I kept them (with the

Re: [Python-Dev] Obtaining stack-frames from co-routine objects

2015-06-13 Thread MRAB
On 2015-06-13 11:38, jaivish kothari wrote: Hi , I had a Question,i hope i'll find the solution here. Say i have a Queue. >>> h = Queue.Queue(maxsize=0) >>> h.put(1) >>> h.put(2) >>> h.empty() False >>> h.join() >>> h.empty() False >>> h.get() 1 >>> h.get() 2 >>> h.get() Blocked..

Re: [Python-Dev] Unicode 8.0 and 3.5

2015-06-18 Thread MRAB
On 2015-06-18 19:33, Larry Hastings wrote: On 06/18/2015 11:27 AM, Terry Reedy wrote: Unicode 8.0 was just released. Can we have unicodedata updated to match in 3.5? What does this entail? Data changes, code changes, both? It looks like just data changes. There are additional codepoints

Re: [Python-Dev] Unicode 8.0 and 3.5

2015-06-18 Thread MRAB
On 2015-06-19 00:56, Steven D'Aprano wrote: On Thu, Jun 18, 2015 at 08:34:14PM +0100, MRAB wrote: On 2015-06-18 19:33, Larry Hastings wrote: >On 06/18/2015 11:27 AM, Terry Reedy wrote: >>Unicode 8.0 was just released. Can we have unicodedata updated to >>match in 3.5?

Re: [Python-Dev] How far to go with user-friendliness

2015-07-14 Thread MRAB
On 2015-07-14 14:09, Nick Coghlan wrote: On 14 July 2015 at 22:53, Xavier Morel wrote: On 2015-07-14, at 14:39 , Nick Coghlan wrote: On 14 July 2015 at 22:06, Dima Tisnek wrote: Thus the question, how far should Python go to detect possible erroneous user behaviour? Granted it is in test

Re: [Python-Dev] How far to go with user-friendliness

2015-07-14 Thread MRAB
On 2015-07-14 23:05, Ethan Furman wrote: On 07/14/2015 02:53 PM, Robert Collins wrote: On 15 July 2015 at 09:41, A.M. Kuchling wrote: On Tue, Jul 14, 2015 at 09:53:33AM -0700, Ethan Furman wrote: Part of writing tests is making sure they fail (and for the right reason) -- proper testing of t

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

2015-07-27 Thread MRAB
On 2015-07-27 15:46, Lennart Regebro wrote: On Mon, Jul 27, 2015 at 4:13 PM, Steven D'Aprano wrote: To me, Paul's example is a datetime operation: you start with a datetime (7am today), perform arithmetic on it by adding a period of time (one day), and get a datetime as the result (7am tomorrow

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

2015-07-27 Thread MRAB
On 2015-07-27 15:59, Paul Moore wrote: On 27 July 2015 at 14:59, R. David Murray wrote: I have a feeling that I'm completely misunderstanding things, since tzinfo is still a bit of a mystery to me. You're not the only one :-) I think the following statements are true. If they aren't, I'd app

Re: [Python-Dev] PEP-498: Literal String Formatting

2015-08-09 Thread MRAB
On 2015-08-10 01:24, Peter Ludemann via Python-Dev wrote: What if logging understood lambda? (By testing for types.FunctionType). [snip] Why not use 'callable'? ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinf

Re: [Python-Dev] PEP-498: Literal String Formatting

2015-08-10 Thread MRAB
On 2015-08-10 20:23, Guido van Rossum wrote: On Mon, Aug 10, 2015 at 8:49 PM, Eric V. Smith mailto:e...@trueblade.com>> wrote: On 08/10/2015 02:44 PM, Yury Selivanov wrote: > On 2015-08-10 2:37 PM, Eric V. Smith wrote: >> This is why I think PEP-498 isn't the solution for i18n. I'd r

Re: [Python-Dev] PEP 498 f-string: please remove the special case for spaces

2015-08-10 Thread MRAB
On 2015-08-10 23:54, Victor Stinner wrote: PEP 498: """ Leading whitespace in expressions is skipped Because expressions may begin with a left brace ('{'), there is a problem when parsing such expressions. For example: f'{{k:v fo

Re: [Python-Dev] PEP 498 f-string: please remove the special case for spaces

2015-08-10 Thread MRAB
On 2015-08-11 00:26, Victor Stinner wrote: Le mardi 11 août 2015, Eric V. Smith mailto:e...@trueblade.com>> a écrit : It sounds like you want to disallow leading spaces just to disallow this one type of expression. I would like to reduce the number of subtle differences between f-str

[Python-Dev] Can't import tkinter in Python 3.5.0rc1

2015-08-11 Thread MRAB
As the subject says, I'm unable to import tkinter in Python 3.5.0rc1. The console says: C:\Python35>python Python 3.5.0rc1 (v3.5.0rc1:1a58b1227501, Aug 10 2015, 05:18:45) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import tkin

Re: [Python-Dev] Can't import tkinter in Python 3.5.0rc1

2015-08-11 Thread MRAB
On 2015-08-12 02:05, Steve Dower wrote: We saw and fixed it before RC 1. I'll check whether that fix didn't stick, but go ahead, open an issue and assign me. It's issue 24847. From: M

Re: [Python-Dev] PEP-498: Literal String Formatting

2015-08-17 Thread MRAB
On 2015-08-17 23:06, Steve Dower wrote: On 17Aug2015 0813, Barry Warsaw wrote: On Aug 18, 2015, at 12:58 AM, Chris Angelico wrote: The linters could tell you that you have no 'end' or 'start' just as easily when it's in that form as when it's written out in full. Certainly the mismatched brack

[Python-Dev] Can't install Python 3.5rc3

2015-09-07 Thread MRAB
of Python 3.5. I'm on Windows 10. Here's the contents of the log file: [0A40:1CC8][2015-09-08T04:29:45]i001: Burn v3.10.0.1823, Windows v10.0 (Build 10240: Service Pack 0), path: C:\Users\MRAB\Downloads\Python\python-3.5.0rc3.exe [0A40:1CC8][2015-09-08T04:29:45]i000: Initializing st

Re: [Python-Dev] Can't install Python 3.5rc3

2015-09-08 Thread MRAB
ot. Thanks for the heads up. > I purged the xPython bits, but it still wouldn't install. I then purged the Python3.5dev... bits. Success! Rather a messy fix though... > > From: MRAB > Sent: ‎9/‎7/‎2015 20:41 > To: Python-Dev > Subject: [Python-Dev] Can't install Pyt

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

2015-09-11 Thread MRAB
On 2015-09-12 02:23, Alexander Belopolsky wrote: On Fri, Sep 11, 2015 at 8:56 PM, Random832 mailto:random...@fastmail.com>> wrote: Alexander Belopolsky mailto:alexander.belopol...@gmail.com>> writes: > There is no "earlier" or "later". There are "lesser" and "greater" > which are al

Re: [Python-Dev] VS 2010 compiler

2015-09-28 Thread MRAB
On 2015-09-28 19:00, Erik Bray wrote: On Fri, Sep 25, 2015 at 6:27 PM, Chris Barker - NOAA Federal wrote: You can use "Windows SDK for Windows 7 and .NET Framework 4". http://www.microsoft.com/en-us/download/details.aspx?id=8279 Thanks. Last time I tried that route, it was for 64 bit py2.7.

Re: [Python-Dev] VS 2010 compiler

2015-09-28 Thread MRAB
On 2015-09-28 21:38, Paul Moore wrote: On 28 September 2015 at 21:18, MRAB wrote: > Same here. I compile the regex module for Python 2.5-2.7 and 3.1-3.5, > both 32-bit and 64-bit, using MinGW-w64, and I haven't had a problem yet > that wasn't due to a bug in the source code.

Re: [Python-Dev] Should PEP 498 specify if rf'...' is valid?

2015-10-26 Thread MRAB
On 2015-10-26 18:45, Sven R. Kunze wrote: On 26.10.2015 16:22, Ethan Furman wrote: On 10/23/2015 08:20 AM, Nick Coghlan wrote: My own objection isn't to allowing "fR" or "fbR", it's to allowing the uppercase "F". I also don't understand why we can't say "if 'f' is part of a string prefix, it m

Re: [Python-Dev] Reading Python source file

2015-11-16 Thread MRAB
On 2015-11-17 01:53, Serhiy Storchaka wrote: I'm working on rewriting Python tokenizer (in particular the part that reads and decodes Python source file). The code is complicated. For now there are such cases: * Reading from the string in memory. * Interactive reading from the file. * Reading fr

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

2015-12-03 Thread MRAB
On 2015-12-03 15:09, Random832 wrote: On 2015-12-03, Laura Creighton wrote: Who came up with the word 'display' and what does it have going for it that I have missed? Right now I think its chief virtue is that it is a meaningless noun. (But not meaningless enough, as I associate displays with

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

2015-12-03 Thread MRAB
On 2015-12-04 01:25, Steven D'Aprano wrote: On Thu, Dec 03, 2015 at 09:25:53AM -0800, Andrew Barnert via Python-Dev wrote: > On Dec 3, 2015, at 08:15, MRAB wrote: > >>> On 2015-12-03 15:09, Random832 wrote: >>> On 2015-12-03, Laura Creighton wrote: >>> W

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

2015-12-03 Thread MRAB
On 2015-12-04 01:56, Chris Angelico wrote: On Fri, Dec 4, 2015 at 12:25 PM, Steven D'Aprano wrote: I don't see any good reason for maintaining that there's just one syntax, "display", which comes in two forms: a comma-separated set of values, or a for-loop. The only thing they have in common (s

Re: [Python-Dev] Third milestone of FAT Python

2015-12-04 Thread MRAB
On 2015-12-04 12:49, Victor Stinner wrote: [snip] Constant folding This optimization propagates constant values of variables. Example: def func() x = 1 y = x return y Constant folding: def func() x = 1 y = 1 ret

Re: [Python-Dev] Third milestone of FAT Python

2015-12-04 Thread MRAB
On 2015-12-04 19:22, Isaac Morland wrote: On Fri, 4 Dec 2015, MRAB wrote: > Constant folding is when, say, "1 + 2" replaced by "2". Isn't that called backspacing? ;-) Oops! I meant "1 + 1", of course. Or "3". Either would work. :-) __

  1   2   3   4   5   6   >