Re: [Python-Dev] Adding NewType() to PEP 484

2016-05-27 Thread Guido van Rossum
On Fri, May 27, 2016 at 6:59 PM, Greg Ewing wrote: > Steven D'Aprano wrote: > >> TypeAlias? Because A is an alias for int? > > > That suggests it's just another name for the same type, > but it's not. It's a distinct type as far as the static > type checker is

Re: [Python-Dev] Adding NewType() to PEP 484

2016-05-27 Thread Greg Ewing
Steven D'Aprano wrote: TypeAlias? Because A is an alias for int? That suggests it's just another name for the same type, but it's not. It's a distinct type as far as the static type checker is concerned. -- Greg ___ Python-Dev mailing list

Re: [Python-Dev] Adding NewType() to PEP 484

2016-05-27 Thread Greg Ewing
Guido van Rossum wrote: Also -- the most important thing. :-) What to call these things? We're pretty much settled on the semantics and how to create them (A = NewType('A', int)) but what should we call types like A when we're talking about them? "New types" sounds awkward. Fake types? Virtual

Re: [Python-Dev] Adding NewType() to PEP 484

2016-05-27 Thread Steven D'Aprano
On Fri, May 27, 2016 at 04:01:11PM -0700, Guido van Rossum wrote: > Also -- the most important thing. :-) What to call these things? We're > pretty much settled on the semantics and how to create them (A = > NewType('A', int)) but what should we call types like A when we're > talking about them?

Re: [Python-Dev] New hash algorithms: SHA3, SHAKE, BLAKE2, truncated SHA512

2016-05-27 Thread Bernardo Sulzbach
On 05/27/2016 07:52 PM, Nathaniel Smith wrote: If we demote them to second-class support (by making them only > available in some builds, or using a slow pure Python implementation), > then we'll be encouraging users to use inferior hashes. We shouldn't > do this without a very good reason. I

Re: [Python-Dev] Adding NewType() to PEP 484

2016-05-27 Thread Guido van Rossum
Also -- the most important thing. :-) What to call these things? We're pretty much settled on the semantics and how to create them (A = NewType('A', int)) but what should we call types like A when we're talking about them? "New types" sounds awkward. On Fri, May 27, 2016 at 12:54 PM, Guido van

Re: [Python-Dev] New hash algorithms: SHA3, SHAKE, BLAKE2, truncated SHA512

2016-05-27 Thread Nathaniel Smith
On Fri, May 27, 2016 at 3:08 PM, M.-A. Lemburg wrote: > On 27.05.2016 23:46, Donald Stufft wrote: >> >>> On May 27, 2016, at 5:41 PM, M.-A. Lemburg wrote: >>> >>> If we add this now, there should at least be an exit strategy >>> to remove the code again, when

Re: [Python-Dev] New hash algorithms: SHA3, SHAKE, BLAKE2, truncated SHA512

2016-05-27 Thread M.-A. Lemburg
On 27.05.2016 23:46, Donald Stufft wrote: > >> On May 27, 2016, at 5:41 PM, M.-A. Lemburg wrote: >> >> If we add this now, there should at least be an exit strategy >> to remove the code again, when OpenSSL ships with the same >> code, IMO. > > I think it is a clear win to have

Re: [Python-Dev] New hash algorithms: SHA3, SHAKE, BLAKE2, truncated SHA512

2016-05-27 Thread Donald Stufft
> On May 27, 2016, at 5:41 PM, M.-A. Lemburg wrote: > > If we add this now, there should at least be an exit strategy > to remove the code again, when OpenSSL ships with the same > code, IMO. I think it is a clear win to have the fallback implementations in cases where

Re: [Python-Dev] New hash algorithms: SHA3, SHAKE, BLAKE2, truncated SHA512

2016-05-27 Thread M.-A. Lemburg
On 27.05.2016 22:58, Ryan Gonzalez wrote: > On May 27, 2016 3:04 PM, "Victor Stinner" wrote: >> >> Le vendredi 27 mai 2016, M.-A. Lemburg a écrit : >>> >>> The current patch is 1.2MB for SHA-3 - that's pretty heavy for just >>> a few hash functions,

Re: [Python-Dev] New hash algorithms: SHA3, SHAKE, BLAKE2, truncated SHA512

2016-05-27 Thread Ryan Gonzalez
On May 27, 2016 3:04 PM, "Victor Stinner" wrote: > > Le vendredi 27 mai 2016, M.-A. Lemburg a écrit : >> >> The curent patch is 1.2MB for SHA-3 - that's pretty heavy for just >> >> a few hash functions, which aren't in any wide spread use yet and >>

Re: [Python-Dev] New hash algorithms: SHA3, SHAKE, BLAKE2, truncated SHA512

2016-05-27 Thread Victor Stinner
Le vendredi 27 mai 2016, M.-A. Lemburg a écrit : > > The curent patch is 1.2MB for SHA-3 - that's pretty heavy for just > a few hash functions, which aren't in any wide spread use yet and > probably won't be for quite a few years ahead. Oh wow, it's so fat? Why is it so big?

Re: [Python-Dev] Adding NewType() to PEP 484

2016-05-27 Thread Guido van Rossum
Sorry, this is more meant to be the start of a discussion about the proposed feature. And typing.py has its own upstream repo (like asyncio). --Guido (mobile) On May 27, 2016 12:52 PM, "Brett Cannon" wrote: > Patches to Python's stdlib should go through bugs.python.org so it

Re: [Python-Dev] Adding NewType() to PEP 484

2016-05-27 Thread Brett Cannon
Patches to Python's stdlib should go through bugs.python.org so it isn't lost in email. On Fri, May 27, 2016, 12:00 Ivan Levkivskyi wrote: > Hi, > > It has been proposed to enhance the typing module with a NewType function > that allows to define simple unique types with

[Python-Dev] Adding NewType() to PEP 484

2016-05-27 Thread Ivan Levkivskyi
Hi, It has been proposed to enhance the typing module with a NewType function that allows to define simple unique types with almost zero runtime overhead. The PR containing actual implementation and PEP 484 update is here: https://github.com/python/typing/pull/226 Review comments are very

Re: [Python-Dev] New hash algorithms: SHA3, SHAKE, BLAKE2, truncated SHA512

2016-05-27 Thread M.-A. Lemburg
On 27.05.2016 18:41, Chris Barker wrote: > On Fri, May 27, 2016 at 9:35 AM, M.-A. Lemburg wrote: > >>> So if ( and that's a big if) it's possible to anticipate what will be >>> in widespread use in a couple years, getting it in now would be a good >>> thing. >> >> You cut away

Re: [Python-Dev] New hash algorithms: SHA3, SHAKE, BLAKE2, truncated SHA512

2016-05-27 Thread Chris Barker
On Fri, May 27, 2016 at 9:35 AM, M.-A. Lemburg wrote: > > So if ( and that's a big if) it's possible to anticipate what will be > > in widespread use in a couple years, getting it in now would be a good > > thing. > > You cut away the important part of what I said: > "The

Re: [Python-Dev] New hash algorithms: SHA3, SHAKE, BLAKE2, truncated SHA512

2016-05-27 Thread M.-A. Lemburg
On 27.05.2016 17:44, Chris Barker - NOAA Federal wrote: >>> , which aren't in any wide spread use yet and >> probably won't be for quite a few years ahead. > > Anything added to the stdlib now will be in py3.6+, yes? > > Which won't be in widespread use for quite a few years yet, either. > >

[Python-Dev] Summary of Python tracker Issues

2016-05-27 Thread Python tracker
ACTIVITY SUMMARY (2016-05-20 - 2016-05-27) Python tracker at http://bugs.python.org/ To view or respond to any of the issues listed below, click on the issue. Do NOT respond to this message. Issues counts and deltas: open5529 (+25) closed 33364 (+42) total 38893 (+67) Open issues

Re: [Python-Dev] New hash algorithms: SHA3, SHAKE, BLAKE2, truncated SHA512

2016-05-27 Thread Chris Barker - NOAA Federal
>> , which aren't in any wide spread use yet and > probably won't be for quite a few years ahead. Anything added to the stdlib now will be in py3.6+, yes? Which won't be in widespread use for quite a few years yet, either. So if ( and that's a big if) it's possible to anticipate what will be in

Re: [Python-Dev] New hash algorithms: SHA3, SHAKE, BLAKE2, truncated SHA512

2016-05-27 Thread Bernardo Sulzbach
On 05/27/2016 11:31 AM, Daniel Holth wrote: > BLAKE2 is important, since it removes the last objection to replacing MD5 - speed - that has made it hard for cryptography fans to convince MD5 users to upgrade. I have had to stick to MD5 for performance reasons (2 seconds in MD5 or 9.6 seconds

[Python-Dev] embedding - PyImport_AppendInittab() after Py_Initialize()

2016-05-27 Thread Vitaly Murashev
Could anyone please clarify whether it is correct in python3.5 to call PyImport_AppendInittab() after Py_Initialize() I found this case among the tests for boost.python https://github.com/boostorg/python/blob/develop/test/exec.cpp And this test doesn't work for me with python3.5.An error looks

Re: [Python-Dev] New hash algorithms: SHA3, SHAKE, BLAKE2, truncated SHA512

2016-05-27 Thread Daniel Holth
OpenSSL sucks. Python would only have to bundle a reference implementation of the new hash algorithm(s), and unlike TLS suites they tend to just work. BLAKE2 is important, since it removes the last objection to replacing MD5 - speed - that has made it hard for cryptography fans to convince MD5

Re: [Python-Dev] New hash algorithms: SHA3, SHAKE, BLAKE2, truncated SHA512

2016-05-27 Thread M.-A. Lemburg
On 27.05.2016 13:03, Donald Stufft wrote: > >> On May 27, 2016, at 6:54 AM, M.-A. Lemburg wrote: >> >> IMO, relying on OpenSSL is a better strategy than providing >> (and maintaining) our own compatibility versions. Until OpenSSL >> has them, people can use Björn's package: > >

Re: [Python-Dev] New hash algorithms: SHA3, SHAKE, BLAKE2, truncated SHA512

2016-05-27 Thread Donald Stufft
> On May 27, 2016, at 6:54 AM, M.-A. Lemburg wrote: > > IMO, relying on OpenSSL is a better strategy than providing > (and maintaining) our own compatibility versions. Until OpenSSL > has them, people can use Björn's package: Even now, hashlib doesn’t rely on OpenSSL if I

Re: [Python-Dev] New hash algorithms: SHA3, SHAKE, BLAKE2, truncated SHA512

2016-05-27 Thread M.-A. Lemburg
On 27.05.2016 06:54, Raymond Hettinger wrote: > >> On May 25, 2016, at 3:29 AM, Christian Heimes wrote: >> >> I have three hashing-related patches for Python 3.6 that are waiting for >> review. Altogether the three patches add ten new hash algorithms to the >> hashlib

Re: [Python-Dev] New hash algorithms: SHA3, SHAKE, BLAKE2, truncated SHA512

2016-05-27 Thread Victor Stinner
Le 27 mai 2016 12:05 PM, "Donald Stufft" a écrit : > BLAKE2 is an interesting one, because while SHA3 is a NIST standard (so it’s going to gain adoption because of that), BLAKE2 is at least as strong as SHA3 but is better in many ways, particularly in speed— it’s actually faster

Re: [Python-Dev] New hash algorithms: SHA3, SHAKE, BLAKE2, truncated SHA512

2016-05-27 Thread Donald Stufft
> On May 27, 2016, at 12:54 AM, Raymond Hettinger > wrote: > > >> On May 25, 2016, at 3:29 AM, Christian Heimes wrote: >> >> I have three hashing-related patches for Python 3.6 that are waiting for >> review. Altogether the three patches