PEP 3107 - Function Annotations thanks to Tony Lownds
diff --git a/Include/Python-ast.h b/Include/Python-ast.h
index 3073347..a159edb 100644
--- a/Include/Python-ast.h
+++ b/Include/Python-ast.h
@@ -30,6 +30,8 @@
 
 typedef struct _arguments *arguments_ty;
 
+typedef struct _arg *arg_ty;
+
 typedef struct _keyword *keyword_ty;
 
 typedef struct _alias *alias_ty;
@@ -74,6 +76,7 @@
                         arguments_ty args;
                         asdl_seq *body;
                         asdl_seq *decorators;
+                        expr_ty returns;
                 } FunctionDef;
                 
                 struct {
@@ -328,12 +331,30 @@
 struct _arguments {
         asdl_seq *args;
         identifier vararg;
+        expr_ty varargannotation;
         asdl_seq *kwonlyargs;
         identifier kwarg;
+        expr_ty kwargannotation;
         asdl_seq *defaults;
         asdl_seq *kw_defaults;
 };
 
+enum _arg_kind {SimpleArg_kind=1, NestedArgs_kind=2};
+struct _arg {
+        enum _arg_kind kind;
+        union {
+                struct {
+                        identifier arg;
+                        expr_ty annotation;
+                } SimpleArg;
+                
+                struct {
+                        asdl_seq *args;
+                } NestedArgs;
+                
+        } v;
+};
+
 struct _keyword {
         identifier arg;
         expr_ty value;
@@ -350,8 +371,8 @@
 mod_ty Expression(expr_ty body, PyArena *arena);
 mod_ty Suite(asdl_seq * body, PyArena *arena);
 stmt_ty FunctionDef(identifier name, arguments_ty args, asdl_seq * body,
-                    asdl_seq * decorators, int lineno, int col_offset, PyArena
-                    *arena);
+                    asdl_seq * decorators, expr_ty returns, int lineno, int
+                    col_offset, PyArena *arena);
 stmt_ty ClassDef(identifier name, asdl_seq * bases, asdl_seq * body, int
                  lineno, int col_offset, PyArena *arena);
 stmt_ty Return(expr_ty value, int lineno, int col_offset, PyArena *arena);
@@ -429,9 +450,12 @@
                                PyArena *arena);
 excepthandler_ty excepthandler(expr_ty type, expr_ty name, asdl_seq * body, int
                                lineno, int col_offset, PyArena *arena);
-arguments_ty arguments(asdl_seq * args, identifier vararg, asdl_seq *
-                       kwonlyargs, identifier kwarg, asdl_seq * defaults,
+arguments_ty arguments(asdl_seq * args, identifier vararg, expr_ty
+                       varargannotation, asdl_seq * kwonlyargs, identifier
+                       kwarg, expr_ty kwargannotation, asdl_seq * defaults,
                        asdl_seq * kw_defaults, PyArena *arena);
+arg_ty SimpleArg(identifier arg, expr_ty annotation, PyArena *arena);
+arg_ty NestedArgs(asdl_seq * args, PyArena *arena);
 keyword_ty keyword(identifier arg, expr_ty value, PyArena *arena);
 alias_ty alias(identifier name, identifier asname, PyArena *arena);
 
diff --git a/Include/funcobject.h b/Include/funcobject.h
index 7acbe6e..5739dd6 100644
--- a/Include/funcobject.h
+++ b/Include/funcobject.h
@@ -30,6 +30,7 @@
     PyObject *func_dict;	/* The __dict__ attribute, a dict or NULL */
     PyObject *func_weakreflist;	/* List of weak references */
     PyObject *func_module;	/* The __module__ attribute, can be anything */
+    PyObject *func_annotations;	/* Annotations, a dict or NULL */
 
     /* Invariant:
      *     func_closure contains the bindings for func_code->co_freevars, so
@@ -52,6 +53,8 @@
 PyAPI_FUNC(int) PyFunction_SetKwDefaults(PyObject *, PyObject *);
 PyAPI_FUNC(PyObject *) PyFunction_GetClosure(PyObject *);
 PyAPI_FUNC(int) PyFunction_SetClosure(PyObject *, PyObject *);
+PyAPI_FUNC(PyObject *) PyFunction_GetAnnotations(PyObject *);
+PyAPI_FUNC(int) PyFunction_SetAnnotations(PyObject *, PyObject *);
 
 /* Macros for direct access to these values. Type checks are *not*
    done, so use with care. */
@@ -67,6 +70,8 @@
 	(((PyFunctionObject *)func) -> func_kwdefaults)
 #define PyFunction_GET_CLOSURE(func) \
 	(((PyFunctionObject *)func) -> func_closure)
+#define PyFunction_GET_ANNOTATIONS(func) \
+	(((PyFunctionObject *)func) -> func_annotations)
 
 /* The classmethod and staticmethod types lives here, too */
 PyAPI_DATA(PyTypeObject) PyClassMethod_Type;
diff --git a/Include/graminit.h b/Include/graminit.h
index 61c0814..5174e58 100644
--- a/Include/graminit.h
+++ b/Include/graminit.h
@@ -5,79 +5,84 @@
 #define decorators 260
 #define funcdef 261
 #define parameters 262
-#define varargslist 263
-#define fpdef 264
-#define fplist 265
-#define stmt 266
-#define simple_stmt 267
-#define small_stmt 268
-#define expr_stmt 269
-#define augassign 270
-#define print_stmt 271
-#define del_stmt 272
-#define pass_stmt 273
-#define flow_stmt 274
-#define break_stmt 275
-#define continue_stmt 276
-#define return_stmt 277
-#define yield_stmt 278
-#define raise_stmt 279
-#define import_stmt 280
-#define import_name 281
-#define import_from 282
-#define import_as_name 283
-#define dotted_as_name 284
-#define import_as_names 285
-#define dotted_as_names 286
-#define dotted_name 287
-#define global_stmt 288
-#define assert_stmt 289
-#define compound_stmt 290
-#define if_stmt 291
-#define while_stmt 292
-#define for_stmt 293
-#define try_stmt 294
-#define with_stmt 295
-#define with_var 296
-#define except_clause 297
-#define suite 298
-#define testlist_safe 299
-#define old_test 300
-#define old_lambdef 301
-#define test 302
-#define or_test 303
-#define and_test 304
-#define not_test 305
-#define comparison 306
-#define comp_op 307
-#define expr 308
-#define xor_expr 309
-#define and_expr 310
-#define shift_expr 311
-#define arith_expr 312
-#define term 313
-#define factor 314
-#define power 315
-#define atom 316
-#define listmaker 317
-#define testlist_gexp 318
-#define lambdef 319
-#define trailer 320
-#define subscriptlist 321
-#define subscript 322
-#define sliceop 323
-#define exprlist 324
-#define testlist 325
-#define dictsetmaker 326
-#define classdef 327
-#define arglist 328
-#define argument 329
-#define list_iter 330
-#define list_for 331
-#define list_if 332
-#define gen_iter 333
-#define gen_for 334
-#define gen_if 335
-#define testlist1 336
-#define encoding_decl 337
-#define yield_expr 338
+#define typedargslist 263
+#define tname 264
+#define tfpdef 265
+#define tfplist 266
+#define varargslist 267
+#define vname 268
+#define vfpdef 269
+#define vfplist 270
+#define stmt 271
+#define simple_stmt 272
+#define small_stmt 273
+#define expr_stmt 274
+#define augassign 275
+#define print_stmt 276
+#define del_stmt 277
+#define pass_stmt 278
+#define flow_stmt 279
+#define break_stmt 280
+#define continue_stmt 281
+#define return_stmt 282
+#define yield_stmt 283
+#define raise_stmt 284
+#define import_stmt 285
+#define import_name 286
+#define import_from 287
+#define import_as_name 288
+#define dotted_as_name 289
+#define import_as_names 290
+#define dotted_as_names 291
+#define dotted_name 292
+#define global_stmt 293
+#define assert_stmt 294
+#define compound_stmt 295
+#define if_stmt 296
+#define while_stmt 297
+#define for_stmt 298
+#define try_stmt 299
+#define with_stmt 300
+#define with_var 301
+#define except_clause 302
+#define suite 303
+#define testlist_safe 304
+#define old_test 305
+#define old_lambdef 306
+#define test 307
+#define or_test 308
+#define and_test 309
+#define not_test 310
+#define comparison 311
+#define comp_op 312
+#define expr 313
+#define xor_expr 314
+#define and_expr 315
+#define shift_expr 316
+#define arith_expr 317
+#define term 318
+#define factor 319
+#define power 320
+#define atom 321
+#define listmaker 322
+#define testlist_gexp 323
+#define lambdef 324
+#define trailer 325
+#define subscriptlist 326
+#define subscript 327
+#define sliceop 328
+#define exprlist 329
+#define testlist 330
+#define dictsetmaker 331
+#define classdef 332
+#define arglist 333
+#define argument 334
+#define list_iter 335
+#define list_for 336
+#define list_if 337
+#define gen_iter 338
+#define gen_for 339
+#define gen_if 340
+#define testlist1 341
+#define encoding_decl 342
+#define yield_expr 343
diff --git a/Include/token.h b/Include/token.h
index 5aedb69..cdbc965 100644
--- a/Include/token.h
+++ b/Include/token.h
@@ -58,10 +58,11 @@
 #define DOUBLESLASH	48
 #define DOUBLESLASHEQUAL 49
 #define AT              50	
+#define RARROW          51
 /* Don't forget to update the table _PyParser_TokenNames in tokenizer.c! */
-#define OP		51
-#define ERRORTOKEN	52
-#define N_TOKENS	53
+#define OP		52
+#define ERRORTOKEN	53
+#define N_TOKENS	54
 
 /* Special definitions for cooperation with parser */