10000 Fix PEP 0 name parsing by AA-Turner · Pull Request #1386 · python/peps · GitHub
[go: up one dir, main page]

Skip to content

Fix PEP 0 name parsing #1386

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add duplicate names and de-duping logic
  • Loading branch information
AA-Turner committed Jun 21, 2020
commit 8f9db05d3d7aafec0a97c1e13384f25145297be0
5 changes: 5 additions & 0 deletions AUTHORS.csv
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@ Inada Naoki, "Inada, Naoki", Inada
Guido van Rossum, "van Rossum, Guido (GvR)", GvR
Just van Rossum, "van Rossum, Just (JvR)", JvR
The Python core team and community, The Python core team and community, python-dev
P.J. Eby, "Eby, Phillip J.", Eby
Greg Ewing, "Ewing, Gregory", Ewing
Jim Jewett, "Jewett, Jim J.", Jewett
Nathaniel Smith, "Smith, Nathaniel J.", Smith
Martin v. Löwis, "von Löwis, Martin", von Löwis
7 changes: 4 additions & 3 deletions pep0/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import sys
import unicodedata

from itertools import groupby
from operator import attrgetter

from . import constants
Expand Down Expand Up @@ -124,9 +125,9 @@ def verify_email_addresses(peps):


def sort_authors(authors_dict):
authors_list = list(authors_dict.keys())
authors_list.sort(key=attrgetter('sort_by'))
return authors_list
authors_list = sorted(authors_dict.keys(), key=attrgetter("sort_by"))
unique_authors = [next(a) for k, a in groupby(authors_list, key=attrgetter("last_first"))]
return unique_authors

def normalized_last_first(name):
return len(unicodedata.normalize('NFC', name.last_first))
Expand Down
2 changes: 1 addition & 1 deletion pep0/pep.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def __init__(self, author_and_email_tuple, authors_exceptions):
name_dict = authors_exceptions.get(self.first_last)
if name_dict:
self.last_first = name_dict["Surname First"]
self.nick = name_dict["Name Reference"]
self.nick = self.last = name_dict["Name Reference"]
else:
self.set_name_parts()

Expand Down
0