You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2017-11-15.18:31:22.405>created_at=<Date2017-11-13.22:06:50.739>labels= ['type-bug', '3.7']
title='inspect.signature does not respect PEP 8'updated_at=<Date2017-11-15.18:31:22.404>user='https://github.com/ilevkivskyi'
When combining an argument annotation with a default value, use spaces around the = sign (but only for those arguments that have both an annotation and a default).
FWIW, I find the version without the spaces to be more readable (but I don't find annotations to be readable in general, so my opinion may not be worth much :)
Those people who read and write annotations regularly are all using the convention that was added to PEP-8, so let's make inspect follow that lead rather than argue about it here. :-)
Activity
ilevkivskyi commentedon Nov 13, 2017
The string representation of a function signature with annotations is currently like this:
At the same time PEP-8 says:
When combining an argument annotation with a default value, use spaces around the = sign (but only for those arguments that have both an annotation and a default).
Yes:
No:
I think there should be spaces in the signature repr.
bitdancer commentedon Nov 13, 2017
FWIW, I find the version without the spaces to be more readable (but I don't find annotations to be readable in general, so my opinion may not be worth much :)
gvanrossum commentedon Nov 13, 2017
Those people who read and write annotations regularly are all using the convention that was added to PEP-8, so let's make inspect follow that lead rather than argue about it here. :-)
bitdancer commentedon Nov 13, 2017
Agreed.
corona10 commentedon Nov 15, 2017
I've submitted a patch. :)
1st1 commentedon Nov 15, 2017
New changeset 762b957 by Yury Selivanov (Dong-hee Na) in branch 'master':
bpo-32018: Fix inspect.signature repr to follow PEP-8 (bpo-4408)
762b957