Re: [Python-Dev] Discussion on fspath: please wait for a PEP

2016-04-20 Thread Chris Angelico
On Wed, Apr 20, 2016 at 11:58 PM, Ethan Furman <et...@stoneleaf.us> wrote: > On 04/20/2016 04:52 AM, Victor Stinner wrote: > >> Can you please wait for a PEP? Brett Canon and Ethan Furman are >> working on a PEP. > > > Actually, Brett Canon and Chris Angelic

Re: [Python-Dev] pathlib - current status of discussions

2016-04-14 Thread Chris Angelico
On Thu, Apr 14, 2016 at 11:45 PM, Random832 wrote: > On Thu, Apr 14, 2016, at 09:40, Nick Coghlan wrote: >> That's not a *new* problem though, it already exists if you pass in a >> mix of bytes and str: >> >> There's also already a solution (regardless of whether you want

Re: [Python-Dev] pathlib - current status of discussions

2016-04-13 Thread Chris Angelico
On Thu, Apr 14, 2016 at 3:10 AM, Brett Cannon wrote: > https://gist.github.com/brettcannon/b3719f54715787d54a206bc011869aa1 has the > four potential approaches implemented (although it doesn't follow the > "separate functions" approach some are proposing and instead goes with

Re: [Python-Dev] pathlib - current status of discussions

2016-04-13 Thread Chris Angelico
On Thu, Apr 14, 2016 at 5:30 AM, Brett Cannon <br...@python.org> wrote: > > > On Wed, 13 Apr 2016 at 12:25 Chris Angelico <ros...@gmail.com> wrote: >> >> On Thu, Apr 14, 2016 at 3:10 AM, Brett Cannon <br...@python.org> wrote: &

Re: [Python-Dev] When the infamous Bier trunk hits ... where is our Python backup?

2016-04-21 Thread Chris Angelico
On Thu, Apr 21, 2016 at 9:41 PM, Burkhard Meier wrote: > Don't be afraid. > > This is just CEO talk. > > Let's imagine Python without a leader. > > All commercial companies...well ... are we free? > I still have no clue what you're talking about. Every project has a

Re: [Python-Dev] pathlib - current status of discussions

2016-04-13 Thread Chris Angelico
On Thu, Apr 14, 2016 at 5:46 AM, Random832 <random...@fastmail.com> wrote: > On Wed, Apr 13, 2016, at 15:24, Chris Angelico wrote: >> Is that the intention, or should the exception catching be narrower? I >> know it's clunky to write it in Python, but AIUI it's less so in C:

Re: [Python-Dev] Should we fix these errors?

2016-07-22 Thread Chris Angelico
On Sat, Jul 23, 2016 at 12:36 AM, Guido van Rossum wrote: > Somebody did some research and found some bugs in CPython (IIUC). The > published some questionable fragments. If there's a volunteer we could > probably easily fix these. (I know we already have occasional Coverity >

Re: [Python-Dev] Status of Python 3.6 PEPs?

2016-07-12 Thread Chris Angelico
On Tue, Jul 12, 2016 at 7:26 PM, Victor Stinner wrote: > "PEP 499 -- python -m foo should bind sys.modules['foo'] in addition > to sys.modules['__main__']" > https://www.python.org/dev/peps/pep-0499/ > => draft > I have a vague recollection that this ran into some

Re: [Python-Dev] Rewrite @contextlib.contextmanager in C

2016-08-10 Thread Chris Angelico
On Wed, Aug 10, 2016 at 4:43 AM, Giampaolo Rodola' wrote: > Chris' SimplerContextManager solution is faster because it avoids the > factory function but that is necessary for supporting the decoration of > methods. Hooking a tangent onto this: I have no idea, based on the

Re: [Python-Dev] Breaking up the stdlib (Was: release cadence)

2016-07-05 Thread Chris Angelico
On Tue, Jul 5, 2016 at 5:53 PM, Petr Viktorin wrote: > If packages had a way to opt-out of needing the whole standard library, > and instead specify the stdlib subset they need, answering questions > like "will this run on my phone?" and "what piece of the stdlib do we > want

Re: [Python-Dev] Proposal: explicitly disallow function/class mismatches in accelerator modules

2016-07-11 Thread Chris Angelico
On Mon, Jul 11, 2016 at 4:25 PM, Ethan Furman <et...@stoneleaf.us> wrote: > On 07/10/2016 08:32 PM, Chris Angelico wrote: >> >> On Mon, Jul 11, 2016 at 1:26 PM, Steven D'Aprano <st...@pearwood.info> >> wrote: >>> >>> (1) How much extra

Re: [Python-Dev] Proposal: explicitly disallow function/class mismatches in accelerator modules

2016-07-10 Thread Chris Angelico
On Mon, Jul 11, 2016 at 1:26 PM, Steven D'Aprano wrote: > (1) How much extra effort are we going to *mandate* that core devs put > in to hide the differences between C and Python code, for the benefit of > a small minority that will notice them? > The subject line is raising

Re: [Python-Dev] Breaking up the stdlib (Was: release cadence)

2016-07-06 Thread Chris Angelico
On Wed, Jul 6, 2016 at 7:01 PM, Petr Viktorin wrote: > Maybe a good short-term solution would be to make "import tkinter" raise > ImportError("Run `dnf install tkinter` to install the tkinter module") > if not found. This would prevent confusion while keeping the status quo. >

Re: [Python-Dev] Rewrite @contextlib.contextmanager in C

2016-08-08 Thread Chris Angelico
On Tue, Aug 9, 2016 at 7:14 AM, Wolfgang Maier wrote: > Right, I think a fairer comparison would be to: > > class ctx2: > def __enter__(self): > self.it = iter(self) > return next(self.it) > > def __exit__(self, *args): >

Re: [Python-Dev] Rewrite @contextlib.contextmanager in C

2016-08-09 Thread Chris Angelico
On Wed, Aug 10, 2016 at 4:43 AM, Giampaolo Rodola' wrote: > -return self.__class__(self.func, self.args, self.kwds) > +func, args, kwds = self.funcak > +return self.__class__(func, args, kwds) return self.__class__(*self.funcak) > @wraps(func) >

Re: [Python-Dev] Generator objects and list comprehensions?

2017-01-24 Thread Chris Angelico
On Wed, Jan 25, 2017 at 4:38 PM, Craig Rodrigues wrote: > > Glyph pointed this out to me here: > http://twistedmatrix.com/pipermail/twisted-python/2017-January/031106.html > > If I do this on Python 3.6: > >>> [(yield 1) for x in range(10)] > at 0x10cd210f8> > > If I

Re: [Python-Dev] Is this a bug or a feature?

2017-02-16 Thread Chris Angelico
On Fri, Feb 17, 2017 at 7:33 AM, Patrick Wallinger wrote: > zipimport.ZipImportError: can't decompress data; zlib not available > There may very well be a bug here of the form of "zlib dependency is considered soft, but then something else breaks". However, in your current

Re: [Python-Dev] Failures in test_site.py - how to debug?

2016-08-19 Thread Chris Angelico
On Sat, Aug 20, 2016 at 2:25 AM, Steve Dower <steve.do...@python.org> wrote: > On 19Aug2016 0910, Chris Angelico wrote: >> >> On Sat, Aug 20, 2016 at 1:26 AM, Steve Dower <steve.do...@python.org> >> wrote: >>> >>> Check any .pth files

[Python-Dev] Failures in test_site.py - how to debug?

2016-08-19 Thread Chris Angelico
On my main dev system (Debian Stretch), I've had a single long-standing test failure - test_site.py, StartupImportTests.test_startup_imports. It's annoying (partly because it's such a noisy failure), and doesn't appear to be happening on the buildbots, nor presumably on core devs' computers, so

Re: [Python-Dev] Adding PEP 515's '_' formatting

2016-08-19 Thread Chris Angelico
On Fri, Aug 19, 2016 at 6:35 PM, Eric V. Smith wrote: > PEP 515 adds underscores to numeric literals. As part of that, it adds > optional underscores to numeric formatters (similar to PEP 378 for ','). See > https://www.python.org/dev/peps/pep-0515/#further-changes > > I had

Re: [Python-Dev] Failures in test_site.py - how to debug?

2016-08-19 Thread Chris Angelico
On Sat, Aug 20, 2016 at 12:31 AM, Random832 wrote: > the -v output might be helpful in determining what is causing these > modules to be imported. It would at least show what order they're > imported in. Here it is in all its spammy glory. rosuav@sikorsky:~/cpython$

Re: [Python-Dev] Failures in test_site.py - how to debug?

2016-08-19 Thread Chris Angelico
On Sat, Aug 20, 2016 at 1:26 AM, Steve Dower wrote: > Check any .pth files you can find. I suspect mpl_toolkits has some magic in > it to make the namespace package work on 2.7. >>> sys.path ['/usr/local/lib/python36.zip', '/home/rosuav/cpython/Lib',

Re: [Python-Dev] Failures in test_site.py - how to debug?

2016-08-19 Thread Chris Angelico
On Sat, Aug 20, 2016 at 7:55 AM, Chris Angelico <ros...@gmail.com> wrote: > If I make a patch to do that, would it have a good chance of being accepted? > Shortcut. I've made the patch and put it on the tracker. http://bugs.python.org/issue27807 Either it's accepted or it's not :

Re: [Python-Dev] Failures in test_site.py - how to debug?

2016-08-19 Thread Chris Angelico
On Sat, Aug 20, 2016 at 7:34 AM, Brett Cannon wrote: >> 1) Demand that .pth files restrict themselves to what's already >> imported. This means startup is still fast even if you have a bunch of >> pths. Downside: Third-party code can break Python's rules. Upside: >> When they

Re: [Python-Dev] Failures in test_site.py - how to debug?

2016-08-19 Thread Chris Angelico
On Sat, Aug 20, 2016 at 8:07 AM, Sjoerd Job Postmus wrote: > I'd like to re-iterate my suggestion in case it was missed: split the > current test in 2 tests: > > * Running with `-S` which is for checking that by default the collections > are not imported. (Which is what is

Re: [Python-Dev] Failures in test_site.py - how to debug?

2016-08-19 Thread Chris Angelico
On Sat, Aug 20, 2016 at 5:33 AM, Brett Cannon wrote: >> Hmmm. So the question is, what is this test testing? > > > It's making sure people who work on the modules that are imported during > startup don't accidentally add another module dependency to the startup > sequence.

Re: [Python-Dev] Failures in test_site.py - how to debug?

2016-08-19 Thread Chris Angelico
On Sat, Aug 20, 2016 at 12:55 PM, Random832 wrote: > > What about -S and putting "import site" explicitly in the test code? Or > would that go back to importing everything on people who have packages > installed? I think so, yes. > Really, there should be a

Re: [Python-Dev] Update on PEP 523 and adding a co_extra field to code objects

2016-09-02 Thread Chris Angelico
On Sat, Sep 3, 2016 at 7:56 AM, Brett Cannon wrote: > On Fri, 2 Sep 2016 at 13:31 Dino Viehland via Python-Dev > wrote: >> >> So it looks like both list and tuple are about within 5% of using co_extra >> directly. Using a tuple instead of a list is about

Re: [Python-Dev] Update on PEP 523 and adding a co_extra field to code objects

2016-09-02 Thread Chris Angelico
On Sat, Sep 3, 2016 at 8:45 AM, Brett Cannon wrote: >> I'm not following how this solves the collision problem. If you have a >> tuple, how do the two (or more) users of it know which index they're >> using? They'd need to keep track separately for each object, or else >>

Re: [Python-Dev] What should a good type checker do? (was: Please reject or postpone PEP 526)

2016-09-02 Thread Chris Angelico
On Sat, Sep 3, 2016 at 8:49 AM, Koos Zevenhoven wrote: > On Fri, Sep 2, 2016 at 9:04 PM, Steven D'Aprano wrote: >> On Fri, Sep 02, 2016 at 08:10:24PM +0300, Koos Zevenhoven wrote: >> >>> A good checker should be able to infer that x is a union type at the

Re: [Python-Dev] Update on PEP 523 and adding a co_extra field to code objects

2016-09-03 Thread Chris Angelico
On Sun, Sep 4, 2016 at 2:09 AM, Nick Coghlan <ncogh...@gmail.com> wrote: > On 3 September 2016 at 08:50, Chris Angelico <ros...@gmail.com> wrote: >> Got it, thanks. I hope the vagaries of linear search don't mess with >> profilers - a debugger isn't going to be bothered

Re: [Python-Dev] Tweak to PEP 523 for storing a tuple in co_extra

2016-09-03 Thread Chris Angelico
On Sun, Sep 4, 2016 at 9:49 AM, Yury Selivanov <yselivanov...@gmail.com> wrote: > > > On 2016-09-03 4:13 PM, Chris Angelico wrote: >> Replace it, but only as they register themselves with a particular >> function. Imagine a profiler doing something vaguely like th

Re: [Python-Dev] Tweak to PEP 523 for storing a tuple in co_extra

2016-09-03 Thread Chris Angelico
On Sun, Sep 4, 2016 at 8:03 AM, Yury Selivanov wrote: > On 2016-09-03 12:27 PM, Brett Cannon wrote: >> >> Below is the `co_extra` section of PEP 523 with the update saying that >> users are expected to put a tuple in the field for easier simultaneous use >> of the field.

Re: [Python-Dev] Please reject or postpone PEP 526

2016-09-05 Thread Chris Angelico
On Tue, Sep 6, 2016 at 2:17 AM, Steven D'Aprano wrote: >> > The type comment systax is required for Python 2 and backwards- >> > compatibility. That's a given. >> >> Sure, but all type checkers will not have to care about Python 2. > > They will have to care about type

Re: [Python-Dev] Do PEP 526 type declarations define the types of variables or not?

2016-09-06 Thread Chris Angelico
On Wed, Sep 7, 2016 at 4:11 AM, Stephen J. Turnbull wrote: > Finally, the notion of annotating expressions is incoherent: > > # Annotating (sub)expressions: the more the merrier! > (x) : bool = (((y): int + (z): float) / (w): complex): quarternion >

Re: [Python-Dev] Please reject or postpone PEP 526

2016-09-04 Thread Chris Angelico
On Sun, Sep 4, 2016 at 8:52 PM, Mark Shannon wrote: > The key difference is in placement. > PEP 484 style > variable = value # annotation > > Which reads to me as if the annotation refers to the value. > PEP 526 > variable: annotation = value > > Which reads very much as if the

Re: [Python-Dev] Update on PEP 523 and adding a co_extra field to code objects

2016-08-30 Thread Chris Angelico
On Wed, Aug 31, 2016 at 4:55 AM, Serhiy Storchaka wrote: > On 30.08.16 21:20, Antoine Pitrou wrote: >> >> On Tue, 30 Aug 2016 18:12:01 + >> Brett Cannon wrote: Why not make it always a list? List objects are reasonably cheap in memory

Re: [Python-Dev] (some) C99 added to PEP 7

2016-09-08 Thread Chris Angelico
On Fri, Sep 9, 2016 at 2:39 AM, Random832 wrote: > On Thu, Sep 8, 2016, at 12:30, Chris Barker wrote: >> That's why I said "based on" -- under the hood, a C type is used, and >> IIUC, that type has been "long" for ages. And a long on Windows 64 >> (with the MS compiler

Re: [Python-Dev] Drastically improving list.sort() for lists of strings/ints

2016-09-11 Thread Chris Angelico
On Sun, Sep 11, 2016 at 5:45 PM, Elliot Gorokhovsky wrote: > I am interested in making a non-trivial improvement to list.sort(), but > before I put in the work, I want to test the waters and see if this is > something the community would accept. Basically, I want to

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

2016-09-08 Thread Chris Angelico
On Fri, Sep 9, 2016 at 6:22 AM, Victor Stinner wrote: > A nice "side effect" of compact dict is that the dictionary now > preserves the insertion order. It means that keyword arguments can now > be iterated by their creation order: > This is pretty sweet! Of course,

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

2016-09-12 Thread Chris Angelico
On Tue, Sep 13, 2016 at 2:27 AM, Gregory P. Smith wrote: > Disorder for this purpose need not be a random shuffle (overkill). It just > needs to be regularly inconsistent. A simple thing to do on top of 3.6's new > dict implementation would be to pick a random starting point

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

2016-09-11 Thread Chris Angelico
On Sun, Sep 11, 2016 at 6:42 PM, Victor Stinner wrote: > 2016-09-10 23:24 GMT-04:00 Nick Coghlan : >> To conform with the updated language spec, implementations just need >> to use collections.OrderedDict in 3 places: >> >> (...) >> - storage type for

Re: [Python-Dev] cpython (3.6): replace usage of Py_VA_COPY with the (C99) standard va_copy

2016-09-23 Thread Chris Angelico
On Fri, Sep 23, 2016 at 4:47 PM, Benjamin Peterson wrote: > On Thu, Sep 22, 2016, at 04:44, Victor Stinner wrote: >> 2016-09-22 8:02 GMT+02:00 Benjamin Peterson : >> > Just dump the compat macros in Python 4.0 I think. >> >> Please don't. Python 3 was so

Re: [Python-Dev] Supported versions of OpenSSL

2016-08-29 Thread Chris Angelico
On Mon, Aug 29, 2016 at 6:24 PM, Christian Heimes wrote: > No, LTS support should not be our concern. If you need a brand new > version of Python on an old LTS or Enterprise version of your OS, please > contact your vendor and buy support. You don't get to run old metal and

Re: [Python-Dev] Supported versions of OpenSSL

2016-08-29 Thread Chris Angelico
On Mon, Aug 29, 2016 at 8:52 PM, Nick Coghlan <ncogh...@gmail.com> wrote: > On 29 August 2016 at 19:14, Chris Angelico <ros...@gmail.com> wrote: >> On Mon, Aug 29, 2016 at 6:24 PM, Christian Heimes <christ...@python.org> >> wrote: >>> No, LTS support shou

Re: [Python-Dev] Supported versions of OpenSSL

2016-08-29 Thread Chris Angelico
On Mon, Aug 29, 2016 at 9:16 PM, Nick Coghlan <ncogh...@gmail.com> wrote: > On 29 August 2016 at 21:05, Chris Angelico <ros...@gmail.com> wrote: >> On Mon, Aug 29, 2016 at 8:52 PM, Nick Coghlan <ncogh...@gmail.com> wrote: >>> For upcoming 3.6 I would like to

Re: [Python-Dev] __future__ and eval()

2016-10-01 Thread Chris Angelico
On Sat, Oct 1, 2016 at 9:39 PM, Christian Tismer wrote: > The exec() script inherited the __future__ statement! > It behaved like the future statement were implicitly there. > > Is that a bug or a feature? It's documented, but not very noisily.

Re: [Python-Dev] __future__ and eval()

2016-10-01 Thread Chris Angelico
On Sat, Oct 1, 2016 at 10:17 PM, Chris Angelico <ros...@gmail.com> wrote: > So I'd call it a feature, but possibly one that warrants a mention in > the exec and eval docs. To clarify: This *is* documented under __future__, but not under exec/eval. I'm just suggesting adding a

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

2016-10-10 Thread Chris Angelico
On Tue, Oct 11, 2016 at 4:03 AM, Paul Moore wrote: > On 10 October 2016 at 17:49, MRAB wrote: >> If you lookup something in a dict, it'll be a borrowed reference. >> >> If the dict is globals() and there's no GIL, another thread could delete the

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

2016-10-10 Thread Chris Angelico
On Tue, Oct 11, 2016 at 3:49 AM, MRAB <pyt...@mrabarnett.plus.com> wrote: > On 2016-10-10 10:45, Chris Angelico wrote: >> >> On Mon, Oct 10, 2016 at 8:35 PM, Larry Hastings <la...@hastings.org> >> wrote: >>> >>> Huh? In all other circumsta

Re: [Python-Dev] Optimizing list.sort() by checking type in advance

2016-10-10 Thread Chris Angelico
On Tue, Oct 11, 2016 at 7:42 AM, Elliot Gorokhovsky wrote: > ChrisA suggested I also try "make test" or something to get a more realistic > benchmark. I will do that once I implement this as a patch, right now it's > an extension module that subclasses list, so I

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

2016-10-10 Thread Chris Angelico
On Tue, Oct 11, 2016 at 5:24 AM, Random832 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 function such as PyWeakref_GetObject() >> that

Re: [Python-Dev] O(1) deletes from the front of bytearray (was: Re: Adding bytes.frombuffer() constructor to PEP 467 (was: [Python-ideas] Adding bytes.frombuffer() constructor)

2016-10-18 Thread Chris Angelico
On Wed, Oct 19, 2016 at 2:57 AM, Chris Barker - NOAA Federal wrote: >> The proposal is that it should be documented as being part of the >> language spec starting in 3.4 (or whatever). > > Is the performance characteristics of any object part of the language spec? > > I.e

Re: [Python-Dev] Bus error in Python 3.6.0beta

2016-11-22 Thread Chris Angelico
On Wed, Nov 23, 2016 at 6:20 AM, Victor Stinner wrote: > It's not bug but a feature :-) Python doesn't protect yourself against > mistakes :-) AIUI the normal way to protect yourself is to unlink (remove) the file and create it from scratch, rather than truncate it.

Re: [Python-Dev] Optimizing list.sort() by checking type in advance

2016-10-11 Thread Chris Angelico
On Wed, Oct 12, 2016 at 12:51 AM, Paul Moore wrote: > On 11 October 2016 at 14:04, Elliot Gorokhovsky > wrote: >> Right, that sounds good, but there's just one thing I don't understand >> that's keeping me from using it. Namely, I would define a

Re: [Python-Dev] Optimizing list.sort() by checking type in advance

2016-10-11 Thread Chris Angelico
On Wed, Oct 12, 2016 at 1:24 AM, Paul Moore <p.f.mo...@gmail.com> wrote: > On 11 October 2016 at 15:00, Chris Angelico <ros...@gmail.com> wrote: >> On Wed, Oct 12, 2016 at 12:51 AM, Paul Moore <p.f.mo...@gmail.com> wrote: >>> On 11 October 2016 at 14:04, Ell

Re: [Python-Dev] Update to PEP 1 re: content type

2016-10-13 Thread Chris Angelico
On Fri, Oct 14, 2016 at 5:09 AM, Mariatta Wijaya wrote: > PEP 1 states that plain/text is an acceptable value for a PEP's content > type, and it is the default value if no content type is specified. > > May I propose adding something along the line of: "new PEPs should

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

2016-10-10 Thread Chris Angelico
On Tue, Oct 11, 2016 at 8:14 AM, Larry Hastings wrote: > But I don't think this fixes the problem. Consider: > > Thread A calls Q = PyList_GetItem(L, 0), which returns a borrowed reference. > Thread A then gets suspended, before it has a chance to Py_INCREF(Q). > Thread B

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

2016-10-10 Thread Chris Angelico
On Tue, Oct 11, 2016 at 9:52 AM, MRAB wrote: >> Also, I don't know when it would ever be safe to release the "memory >> deallocation lock". Just because it's safe for your thread doesn't mean >> it's safe for another thread. And if you do it on a thread-by-thread >>

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

2016-10-10 Thread Chris Angelico
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 borrowed reference is simply a chain of

Re: [Python-Dev] Optimizing list.sort() by checking type in advance

2016-10-10 Thread Chris Angelico
On Mon, Oct 10, 2016 at 5:18 PM, Elliot Gorokhovsky wrote: > First, some simple benchmark results (numbers are seconds, check out the > extension module at https://github.com/embg/python-fast-listsort.git): > > *** 1e3 ints *** > F.fastsort(): 0.00018930435180664062

[Python-Dev] Python ROCKS! Thanks guys! [anecdote]

2016-10-12 Thread Chris Angelico
I work with a full-stack web development bootcamp. Most of the course focuses on JavaScript (Node.js, React, jQuery, etc), but there's a one-week period in which each student gets to pick some technology to learn, and at the end of the week, demos to the group some project s/he has mastered. Two

Re: [Python-Dev] Python ROCKS! Thanks guys! [anecdote]

2016-10-12 Thread Chris Angelico
On Thu, Oct 13, 2016 at 12:01 PM, Ryan Gonzalez <rym...@gmail.com> wrote: > On Wed, Oct 12, 2016 at 7:05 PM, Chris Angelico <ros...@gmail.com> wrote: >> >> I work with a full-stack web development bootcamp. Most of the course >> focuses on JavaScript (Node.js

Re: [Python-Dev] Making sure dictionary adds/deletes during iteration always raise exception

2016-12-13 Thread Chris Angelico
On Wed, Dec 14, 2016 at 4:48 AM, Guido van Rossum wrote: > IIUC the private version gets updated every time the dict gets modified -- > but what we need here should only trigger when a key is added or removed, > not when a value is updated. Is it possible to add a key,

Re: [Python-Dev] Making sure dictionary adds/deletes during iteration always raise exception

2016-12-13 Thread Chris Angelico
On Wed, Dec 14, 2016 at 5:13 AM, Joe Jevnik wrote: >> Is it possible to add a key, triggering a resize of the dict, then > remove one, and continue iterating through the old (deallocated) > memory? > > You can add and remove keys between calling next which would resize the

Re: [Python-Dev] Deprecate `from __future__ import unicode_literals`?

2016-12-16 Thread Chris Angelico
On Sat, Dec 17, 2016 at 8:07 AM, Ethan Furman wrote: > On 12/16/2016 11:24 AM, Guido van Rossum wrote: > >> I am beginning to think that `from __future__ import unicode_literals` >> does >> more harm than good. I don't recall exactly why we introduced it, but >> with >> the

Re: [Python-Dev] Someons's put a "Python 2.8" on GitHub

2016-12-12 Thread Chris Angelico
On Tue, Dec 13, 2016 at 12:18 AM, Nick Coghlan wrote: > It absolutely *is* relevant, as is how diligent the redistributors are > in differentiating between the unmodified upstream project and the > patches we have applied post-release (rather than just posting the end > result

[Python-Dev] A big THANK YOU to the maintainers of What's New

2017-03-14 Thread Chris Angelico
A bit of a thankless job, updating What's New for a bugfix release, but can be so important. Today I was trying to figure out why a Python script behaved differently on my dev system and my server, even when I used Python 3.4 on both ends - but it was 3.4.4 on one and 3.4.2 on the other. My first

Re: [Python-Dev] startup time repeated? why not daemon

2017-07-20 Thread Chris Angelico
On Fri, Jul 21, 2017 at 1:49 PM, Nick Coghlan wrote: > The are some genuine downsides in increasing the complexity of > bootstrapping CPython when all you're starting with is a VCS clone and > a C compiler, but those complications are ultimately no worse than > those we

Re: [Python-Dev] startup time repeated? why not daemon

2017-07-20 Thread Chris Angelico
On Fri, Jul 21, 2017 at 2:09 PM, Nick Coghlan <ncogh...@gmail.com> wrote: > On 21 July 2017 at 13:55, Chris Angelico <ros...@gmail.com> wrote: >> On Fri, Jul 21, 2017 at 1:49 PM, Nick Coghlan <ncogh...@gmail.com> wrote: >>> The are some genuine do

Re: [Python-Dev] 64 bit units in PyLong

2017-07-05 Thread Chris Angelico
On Thu, Jul 6, 2017 at 5:33 AM, Mark Lawrence via Python-Dev wrote: > On 05/07/2017 20:05, Mark Dickinson wrote: > >> Oh, and you'd have to rewrite the power algorithm, which currently >> depends on the size of a limb in bytes being a multiple of 5. :-) >> > > What is a

Re: [Python-Dev] Guarantee the success of some object creation C API functions

2017-05-01 Thread Chris Angelico
On Tue, May 2, 2017 at 6:52 AM, Terry Reedy wrote: > The promise makes it clear that breaking the property is a bug to be fixed. > It only decreases the probability for someone who has read the promise. > Unfortunately, 'never fail' is hard to test ;-). > Aside from straight-up

Re: [Python-Dev] python docs

2017-05-10 Thread Chris Angelico
On Thu, May 11, 2017 at 12:53 AM, Ethan Furman wrote: > Why is python-list the place to send behavioral bugs to? It's been my > experience that folks there will (rightly) ask the individual to file a bug > on the tracker. > How many bug tracker entries do you want to see

Re: [Python-Dev] Helping contributors with chores (do we have to?)

2017-06-25 Thread Chris Angelico
On Sun, Jun 25, 2017 at 7:25 PM, Antoine Pitrou wrote: >> There're also various tools for dealing specifically with git branch >> layout as used by Github, and every real man writes their own (because >> it's easier to shoot a 5-liner than to review whether somebody else's >>

Re: [Python-Dev] Helping contributors with chores (do we have to?)

2017-06-25 Thread Chris Angelico
On Mon, Jun 26, 2017 at 1:52 AM, Antoine Pitrou <solip...@pitrou.net> wrote: > On Mon, 26 Jun 2017 01:27:20 +1000 > Chris Angelico <ros...@gmail.com> wrote: >> On Sun, Jun 25, 2017 at 7:25 PM, Antoine Pitrou <solip...@pitrou.net> wrote: >> >> There're a

Re: [Python-Dev] RFC: Backport ssl.MemoryBIO and ssl.SSLObject to Python 2.7

2017-06-01 Thread Chris Angelico
On Fri, Jun 2, 2017 at 1:01 AM, Cory Benfield wrote: > The answer to that is honestly not clear to me. I chatted with the pip > developers, and they have 90%+ of their users currently on Python 2, but more > than half of those are on 2.7.9 or later. This shows some interest

Re: [Python-Dev] RFC: Backport ssl.MemoryBIO and ssl.SSLObject to Python 2.7

2017-06-01 Thread Chris Angelico
On Fri, Jun 2, 2017 at 2:35 AM, Cory Benfield wrote: > I have figures for the download numbers, which are an awkward proxy because > most people don’t CI on Windows and macOS, but they’re the best we have. > Linux has approximately 20x the download numbers of either Windows

Re: [Python-Dev] RFC: Backport ssl.MemoryBIO and ssl.SSLObject to Python 2.7

2017-06-01 Thread Chris Angelico
On Thu, Jun 1, 2017 at 7:23 PM, Antoine Pitrou wrote: >> Do you also disagree on the need of the need of the PEP 546 >> (backport) to make the PEP 543 (new TLS API) feasible in practice? > > Yes, I disagree. We needn't backport that new API to Python 2.7. > Perhaps it's time

Re: [Python-Dev] RFC: Backport ssl.MemoryBIO and ssl.SSLObject to Python 2.7

2017-06-01 Thread Chris Angelico
On Thu, Jun 1, 2017 at 8:01 PM, Antoine Pitrou <solip...@pitrou.net> wrote: > On Thu, 1 Jun 2017 19:50:22 +1000 > Chris Angelico <ros...@gmail.com> wrote: >> On Thu, Jun 1, 2017 at 7:23 PM, Antoine Pitrou <anto...@python.org> wrote: >> >> Do you also disag

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

2017-10-08 Thread Chris Angelico
On Sun, Oct 8, 2017 at 7:02 PM, David Cournapeau wrote: > It is certainly true that for a CLI tool that actually makes any network > I/O, especially SSL, import times will quickly be negligible. It becomes > tricky for complex tools, because of error management. For example, a

Re: [Python-Dev] PEP 548: More Flexible Loop Control

2017-09-05 Thread Chris Angelico
On Wed, Sep 6, 2017 at 10:11 AM, R. David Murray wrote: > I've written a PEP proposing a small enhancement to the Python loop > control statements. Short version: here's what feels to me like a > Pythonic way to spell "repeat until": > > while: > >

Re: [Python-Dev] To reduce Python "application" startup time

2017-09-05 Thread Chris Angelico
On Wed, Sep 6, 2017 at 2:30 PM, INADA Naoki wrote: >>> This patch moves a few imports inside functions. I wonder whether that kind >>> of change actually helps with real applications—doesn't any real application >>> end up importing the socket module anyway at some point?

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

2017-09-10 Thread Chris Angelico
On Mon, Sep 11, 2017 at 11:03 AM, Barry Warsaw <ba...@python.org> wrote: > On Sep 10, 2017, at 14:39, Chris Angelico <ros...@gmail.com> wrote: >> >> As a language change, definitely not. But I like this idea for >> PYTHONBREAKPOINT. You set it to the name of a func

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

2017-09-10 Thread Chris Angelico
On Mon, Sep 11, 2017 at 7:29 AM, Koos Zevenhoven wrote: > On Sun, Sep 10, 2017 at 8:21 PM, Barry Warsaw wrote: >> >> On Sep 9, 2017, at 15:12, Guido van Rossum wrote: >> > >> > I can't tell whether this was meant seriously, but I don't

Re: [Python-Dev] PEP 551: Security transparency in the Python runtime

2017-08-28 Thread Chris Angelico
On Tue, Aug 29, 2017 at 12:23 PM, Steve Dower wrote: >> Check your line lengths, I think they may be too long? (Or maybe my mail >> client is set too short?) > > > Yeah, not sure what's happened here. Are PEPs supposed to be 80? Or 72? According to the emacs stanza at the

Re: [Python-Dev] Inplace operations for PyLong objects

2017-08-31 Thread Chris Angelico
On Fri, Sep 1, 2017 at 9:35 AM, Manciu, Catalin Gabriel wrote: > A huge Python program with lots of PyLong inplace operations (not just > adds, this can be applied to all PyLong inplace operations), regardless of > them > being in a loop or not, might benefit

Re: [Python-Dev] Inplace operations for PyLong objects

2017-09-01 Thread Chris Angelico
On Sat, Sep 2, 2017 at 6:35 AM, Joe Jevnik via Python-Dev wrote: > Is it true that checking for refcount == 1 is enough? What if a user wrote: > > args = (compute_integer(), 5) > # give away args to someone > int.__iadd__(*args) > > here `args[0]` still has refcount=1

Re: [Python-Dev] PEP 564: Add new time functions with nanosecond resolution

2017-10-22 Thread Chris Angelico
On Mon, Oct 23, 2017 at 2:06 AM, Wes Turner wrote: > What about bus latency (and variance)? I'm currently in Los Angeles. Bus latency is measured in minutes, and may easily exceed sixty of them. :| Seriously though: For applications requiring accurate representation of

Re: [Python-Dev] PEP 565: Show DeprecationWarning in __main__

2017-11-13 Thread Chris Angelico
On Mon, Nov 13, 2017 at 9:46 PM, Antoine Pitrou wrote: > On Sun, 12 Nov 2017 19:48:28 -0800 > Nathaniel Smith wrote: >> On Sun, Nov 12, 2017 at 1:24 AM, Nick Coghlan wrote: >> > This change will lead to DeprecationWarning being displayed

Re: [Python-Dev] Using async/await in place of yield expression

2017-11-26 Thread Chris Angelico
On Mon, Nov 27, 2017 at 2:20 PM, David Mertz wrote: > Changing subject line because this is way off to the side. Guido and > Nathaniel point out that you can do everything yield expressions do with > async/await *without* an explicit event loop. While I know that is true, it >

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

2017-11-22 Thread Chris Angelico
On Thu, Nov 23, 2017 at 3:36 PM, Greg Ewing wrote: > Paul Moore wrote: >> >> 3. List comprehensions are the same as list(the equivalent generator >> expression). > > > I don't think that's ever been quite true -- there have > always been odd cases such as what happens

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

2017-11-23 Thread Chris Angelico
On Fri, Nov 24, 2017 at 1:21 AM, Paul Moore wrote: > On 23 November 2017 at 13:04, Ivan Levkivskyi wrote: >> Let us forget for a moment about other problems and focus on this one: list >> comprehension is currently not equivalent to a for-loop. >> There

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

2017-11-30 Thread Chris Angelico
On Fri, Dec 1, 2017 at 5:45 AM, Tres Seaver wrote: >> I would *not* add any spelling for an explicit bare-except equivalent. >> You would have to write: >> >> val = name.strip()[4:].upper() except Exception as -1 > > > Wouldn't that really need to be this instead, for a

Re: [Python-Dev] [python/peps] PEP 567 review and copyedits (#503)

2017-12-12 Thread Chris Angelico
Redirecting comments from the PR to the ML. Everything that was tightly bound to the PR has been dropped. On Wed, Dec 13, 2017 at 12:15 PM, Yury Selivanov wrote: > Most of your questions should be asked on python-dev. I'll answer them here, > but if you have any

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

2017-12-12 Thread Chris Angelico
On Wed, Dec 13, 2017 at 6:03 AM, Guido van Rossum wrote: > And I'll never approve syntax to make it easier to just ignore all > exceptions without looking at them. Well, I certainly wouldn't advocate "except Exception: -1", but the syntax is the same as "except KeyError: -1"

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

2017-12-18 Thread Chris Angelico
On Tue, Dec 19, 2017 at 6:09 PM, Steven D'Aprano wrote: > I completely agree. We might argue that it was a mistake to sort dicts > in the first place, or at least a mistake to *always* sort them without > allowing the caller to provide a sort key. But what's done is done: the

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

2017-11-06 Thread Chris Angelico
On Mon, Nov 6, 2017 at 9:36 PM, Stefan Krah wrote: > On Mon, Nov 06, 2017 at 12:18:17PM +0200, Paul Sokolovsky wrote: >> MicroPython hashmap implementation is effectively O(n) (average and >> worst case) due to the algorithm parameters chosen (like the load factor >> of 1).

Re: [Python-Dev] The current dict is not an "OrderedDict"

2017-11-07 Thread Chris Angelico
On Wed, Nov 8, 2017 at 1:32 AM, Antoine Pitrou wrote: > On Wed, 8 Nov 2017 00:01:04 +1000 > Nick Coghlan wrote: > >> On 7 November 2017 at 23:48, Stefan Krah wrote: >> > >> > >> > This is just a reminder that the current dict is not

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

2017-12-05 Thread Chris Angelico
On Wed, Dec 6, 2017 at 4:46 PM, Nick Coghlan wrote: > Something I've just noticed that needs to be clarified: on Linux, "C" > locale and "POSIX" locale are aliases, but this isn't true in general > (e.g. it's not the case on *BSD systems, including Mac OS X). For those of us

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

2017-12-12 Thread Chris Angelico
On Tue, Dec 12, 2017 at 7:39 PM, Michel Desmoulin wrote: > > > Le 29/11/2017 à 19:02, Barry Warsaw a écrit : >> On Nov 29, 2017, at 12:40, David Mertz wrote: >> >>> I think some syntax could be possible to only "catch" some exceptions and >>> let

<    1   2   3   4   5   6   7   8   9   10   >