Issue18532
Created on 2013-07-22 20:29 by jaraco, last changed 2022-04-11 14:57 by admin. This issue is now closed.
| Messages (8) | |||
|---|---|---|---|
| msg193563 - (view) | Author: Jason R. Coombs (jaraco) * ![]() |
Date: 2013-07-22 20:29 | |
In hashlib, the HASH objects currently supply a 'name' attribute, reflecting the name used to initialize the hash object, and they have since Python 2.5. However, this interface is not published so isn't honored by other platforms (namely pypy). I propose the '.name' attribute be formally added to the documentation to reflect the actual implementation. I suggest this change be considered as a bugfix release if the original intention was for the '.name' attribute to be public (as it's a bug in the documentation if the intended and implemented interface isn't fully documented). I plan to do some research to ascertain the intention of this attribute (as can be inferred from tests and the source). For now, I'll assume Python 3.4 only. Any comments or suggestions welcome. |
|||
| msg193564 - (view) | Author: Christian Heimes (christian.heimes) * ![]() |
Date: 2013-07-22 20:37 | |
Sounds like a good idea. |
|||
| msg193568 - (view) | Author: Daniel Holth (dholth) * | Date: 2013-07-22 22:05 | |
fwiw pypy 2 supports HASH.name but the older 1.9 (still part of some Linux distributions) did not. |
|||
| msg194242 - (view) | Author: Jason R. Coombs (jaraco) * ![]() |
Date: 2013-08-03 09:43 | |
It's not obvious to me if the authors originally intended to have the 'name' attribute as a formal interface, so I've decided the change should probably be added to Python 3.4. Here's a diff I've put together: http://paste.jaraco.com/tMdQ2 It updates the documentation and adds a test to guarantee the interface. I'm unsure about the RST syntax, so I would appreciate a review of the syntax there. Also, I haven't run the test yet, but I'll do that at a later date. |
|||
| msg194453 - (view) | Author: Roundup Robot (python-dev) ![]() |
Date: 2013-08-05 06:54 | |
New changeset 238c37e4c395 by Jason R. Coombs in branch 'default': Issue 18532: Added tests and documentation to formally specify the .name attribute on hashlib objects. http://hg.python.org/cpython/rev/238c37e4c395 |
|||
| msg194454 - (view) | Author: Jason R. Coombs (jaraco) * ![]() |
Date: 2013-08-05 06:56 | |
I've confirmed the tests pass and the updated documentation renders nicely and without warnings. These changes now make the name attribute officially-supported and tested. |
|||
| msg194545 - (view) | Author: Christian Heimes (christian.heimes) * ![]() |
Date: 2013-08-06 13:52 | |
I added some tests in 5fbf23e947d8 and found a bug in the _sha1 module, too. |
|||
| msg195261 - (view) | Author: Christian Heimes (christian.heimes) * ![]() |
Date: 2013-08-15 16:33 | |
The builtin hash algorithms still had upper case names. I fixed it in revision http://hg.python.org/cpython/rev/9a4949f5d15c |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:57:48 | admin | set | github: 62732 |
| 2013-08-15 16:33:28 | christian.heimes | set | stage: patch review -> resolved |
| 2013-08-15 16:33:22 | christian.heimes | set | messages: + msg195261 |
| 2013-08-06 13:52:44 | christian.heimes | set | status: open -> closed messages: + msg194545 |
| 2013-08-05 06:56:07 | jaraco | set | resolution: fixed messages: + msg194454 |
| 2013-08-05 06:54:54 | python-dev | set | nosy:
+ python-dev messages: + msg194453 |
| 2013-08-03 09:43:46 | jaraco | set | keywords:
+ needs review stage: needs patch -> patch review |
| 2013-08-03 09:43:08 | jaraco | set | messages: + msg194242 |
| 2013-07-22 22:05:40 | dholth | set | nosy:
+ dholth messages: + msg193568 |
| 2013-07-22 20:37:17 | christian.heimes | set | nosy:
+ gregory.p.smith, christian.heimes messages: + msg193564 type: enhancement |
| 2013-07-22 20:29:00 | jaraco | create | |

