(keywords work normally func __annotations__ {' '' '( )' ''spam''return'secondnote that the blank spaces in the prior example are all optional--you can use spaces between components in function headers or notbut omitting them might degrade your code' readability to some observers (and probably improve it to others!)def func( :'spam'= :( , )= :float= )->intreturn func( # + + func __annotations__ {' '' '( )' ''spam''return'annotations are new feature in xand some of their potential uses remain to be uncovered it' easy to imagine annotations being used to specify constraints for argument types or valuesthoughand larger apis might use this feature as way to register function interface information in factwe'll see potential application in where we'll look at annotations as an alternative to function decorator arguments-- more general concept in which information is coded outside the function header and so is not limited to single role like python itselfannotation is tool whose roles are shaped by your imagination finallynote that annotations work only in def statementsnot lambda expressionsbecause lambda' syntax already limits the utility of the functions it defines coincidentallythis brings us to our next topic anonymous functionslambda besides the def statementpython also provides an expression form that generates function objects because of its similarity to tool in the lisp languageit' called lambda like defthis expression creates function to be called laterbut it returns the function instead of assigning it to name this is why lambdas are sometimes known as anonymous ( unnamedfunctions in practicethey are often used as way to inline function definitionor to defer execution of piece of code the lambda tends to intimidate people more than it should this reaction seems to stem from the name "lambdaitself-- name that comes from the lisp languagewhich got it from lambda calculuswhich is form of symbolic logic in pythonthoughit' really just keyword that introduces the expression syntactically obscure mathematical heritage asidelambda is simpler to use than you may think anonymous functionslambda