Fix copying function annotations and keyword-only defaults on Python 3.

Review Request #9707 — Created Feb. 27, 2018 and submitted

Information

kgb
master
cbd4ceb...

Reviewers

kgb

On Python 3, FunctionType's constructor never gained the ability to
specify annotations or defaults for keyword-only arguments. Fortunately,
these are pretty easy to copy over.

This change introduces a new _clone_function() that does the copying
work, simplifying the copying code we had in two places and adding
support for these missing bits of data.

Unit tests pass for all supported Python versions.

Description From Last Updated

E231 missing whitespace after ':'

reviewbotreviewbot

E999 SyntaxError: invalid syntax

reviewbotreviewbot

E231 missing whitespace after ':'

reviewbotreviewbot

E231 missing whitespace after ':'

reviewbotreviewbot

E231 missing whitespace after ':'

reviewbotreviewbot

E231 missing whitespace after ':'

reviewbotreviewbot

E231 missing whitespace after ':'

reviewbotreviewbot

E231 missing whitespace after ':'

reviewbotreviewbot

E231 missing whitespace after ':'

reviewbotreviewbot

E231 missing whitespace after ':'

reviewbotreviewbot

E999 SyntaxError: invalid syntax

reviewbotreviewbot
Checks run (1 failed, 1 succeeded)
flake8 failed.
JSHint passed.

flake8

chipx86
Review request changed
Change Summary:

Fixed styling around annotations for function arguments.

Commit:
1ba328cd147fecf5b9c8e53061f41d7f0e2e0044
cbd4cebb6706496e75e784aff1f28fbf22414c81

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to master (a40d38e)