Fix copying function annotations and keyword-only defaults on Python 3.
Review Request #9707 — Created Feb. 27, 2018 and submitted
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 ':' |
reviewbot | |
E999 SyntaxError: invalid syntax |
reviewbot | |
E231 missing whitespace after ':' |
reviewbot | |
E231 missing whitespace after ':' |
reviewbot | |
E231 missing whitespace after ':' |
reviewbot | |
E231 missing whitespace after ':' |
reviewbot | |
E231 missing whitespace after ':' |
reviewbot | |
E231 missing whitespace after ':' |
reviewbot | |
E231 missing whitespace after ':' |
reviewbot | |
E231 missing whitespace after ':' |
reviewbot | |
E999 SyntaxError: invalid syntax |
reviewbot |
- Change Summary:
-
Fixed styling around annotations for function arguments.
- Commit:
-
1ba328cd147fecf5b9c8e53061f41d7f0e2e0044cbd4cebb6706496e75e784aff1f28fbf22414c81
- Diff:
-
Revision 2 (+111 -13)