{"componentChunkName":"component---node-modules-smooth-doc-src-templates-doc-js","path":"/docs/args-kwargs/","result":{"data":{"mdx":{"fields":{"pageType":"doc","title":"args and kwargs","editLink":""},"body":"var _excluded = [\"components\"];\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n/* @jsxRuntime classic */\n/* @jsx mdx */\n\nvar _frontmatter = {\n  \"title\": \"args and kwargs\",\n  \"section\": \"Quick Docs\",\n  \"order\": 0\n};\nvar layoutProps = {\n  _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  var components = _ref.components,\n    props = _objectWithoutProperties(_ref, _excluded);\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(\"p\", null, \"These special parameters allow functions to take arbitrary amounts of positional and keyword arguments. The names \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"args\"), \" and \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"kwargs\"), \" are purely convention, and could be named any other valid variable name. The special functionality comes from the single and double asterisks (\", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"*\"), \"). If both are used in a function signature, \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"*args\"), \" \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"must\"), \" appear before \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"**kwargs\"), \".\"), mdx(\"p\", null, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"Single asterisk\"), \"\\n\", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"*args\"), \" will ingest an arbitrary amount of \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"positional arguments\"), \", and store it in a tuple. If there are parameters after \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"*args\"), \" in the parameter list with no default value, they will become \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"required\"), \" keyword arguments by default.\"), mdx(\"p\", null, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"Double asterisk\"), \"\\n\", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"**kwargs\"), \" will ingest an arbitrary amount of \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"keyword arguments\"), \", and store it in a dictionary. There can be \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"no\"), \" additional parameters \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"after\"), \" \", mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"**kwargs\"), \" in the parameter list.\"), mdx(\"p\", null, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"Use cases\"), \"  \"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Decorators\"), \" (\", mdx(\"em\", {\n    parentName: \"li\"\n  }, \"see \", mdx(\"a\", {\n    parentName: \"em\",\n    \"href\": \"/docs/decorators\"\n  }, \"decorators\")), \")  \"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Inheritance\"), \" (overriding methods)  \"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Future proofing\"), \" (in the case of the first two bullet points, if the parameters change, your code won't break)  \"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"Flexibility\"), \" (writing functions that behave like \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"dict()\"), \" or \", mdx(\"inlineCode\", {\n    parentName: \"li\"\n  }, \"print()\"), \")  \")), mdx(\"p\", null, mdx(\"em\", {\n    parentName: \"p\"\n  }, \"See positional-keyword for information about positional and keyword arguments\")));\n}\n;\nMDXContent.isMDXComponent = true;","tableOfContents":{}}},"pageContext":{"id":"99755efe-d88d-5b59-9e59-68d83a2db639"}},"staticQueryHashes":["1022386572","1122327541","1339625561","2140385554","3442269102","3597609067"]}