{"id":943,"date":"2021-10-12T01:48:30","date_gmt":"2021-10-11T22:48:30","guid":{"rendered":"https:\/\/1.cbm.ua\/?p=943"},"modified":"2021-10-12T14:19:03","modified_gmt":"2021-10-12T11:19:03","slug":"%d0%bf%d0%b5%d1%80%d0%b5%d0%b3%d1%80%d1%83%d0%b6%d0%b5%d0%bd%d0%bd%d1%8b%d0%b5-%d1%84%d1%83%d0%bd%d0%ba%d1%86%d0%b8%d0%b8-c-%d0%bc%d0%bd%d0%be%d0%b3%d0%be%d0%ba%d1%80%d0%b0%d1%82%d0%bd%d0%b0","status":"publish","type":"post","link":"https:\/\/1.cbm.ua\/?p=943","title":{"rendered":"??? \u041f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 (C++). \u041c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u0430\u044f \u0438\u043b\u0438 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 (Python-3)"},"content":{"rendered":"\n<p><a href=\"https:\/\/alexgyver.ru\/lessons\/functions\/\">URL \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u21161<\/a><\/p>\n\n\n\n<p>\u0412 \u044f\u0437\u044b\u043a\u0435 \u0421++ \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u043e\u043d\u044f\u0442\u0438\u0435 <\/p>\n\n\n\n<p>\u041f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 (\u0438\u043b\u0438 \u041f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438)<\/p>\n\n\n\n<p>\u041f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u044d\u0442\u043e \u0442\u0430\u043a\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437\u00a0<strong>\u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c \u0438\u043c\u0435\u043d\u0435\u043c<\/strong>, \u043d\u043e\u00a0<strong>\u0440\u0430\u0437\u043d\u044b\u043c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u043c \u0442\u0438\u043f\u043e\u043c<\/strong>\u00a0\u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u00a0<strong>\u0440\u0430\u0437\u043d\u044b\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432<\/strong>.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"cpp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">int c;\nfloat d;\nvoid setup() {\n  float af = 5.5;\n  float bf = 0.25;\n  Serial.begin(9600);\n  c = sumFunction(10, 20);      \/\/ \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 30\n  c = sumFunction(10, 20, 30);  \/\/ \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 60\n  d = sumFunction(af, bf);      \/\/ \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 5.75\n  Serial.println(c);\n  Serial.println(d);\n}\nvoid loop() {\n}\nint sumFunction(int paramA, int paramB) {\n  return (paramA + paramB);\n}\nint sumFunction(int paramA, int paramB, int paramC) {\n  return (paramA + paramB + paramC);\n}\nfloat sumFunction(float paramA, float paramB) {\n  return (paramA + paramB);\n}<\/pre>\n\n\n\n<p>\u0418\u0442\u0430\u043a, \u0443 \u043d\u0430\u0441 \u0442\u0435\u043f\u0435\u0440\u044c \u0446\u0435\u043b\u044b\u0445 \u0442\u0440\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c \u0438\u043c\u0435\u043d\u0435\u043c, \u043d\u043e \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u043d\u0430\u0431\u043e\u0440\u0430\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0438 \u0442\u0438\u043f\u043e\u0432 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430<strong>\u00a0\u0441\u0430\u043c\u0430 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u0442\u0441\u044f<\/strong>, \u043a\u0430\u043a\u0443\u044e \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432. \u041f\u0435\u0440\u0435\u0434\u0430\u043b\u0438 \u0434\u0432\u0430\u00a0float\u00a0\u2013 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u0440\u0435\u0442\u044c\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0432\u0435\u0440\u043d\u0451\u0442\u00a0float. \u041f\u0435\u0440\u0435\u0434\u0430\u043b\u0438 \u0442\u0440\u0438\u00a0int\u00a0\u2013 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0438\u0445 \u0441\u0443\u043c\u043c\u0443 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u043e \u0441\u0447\u0451\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041f\u0435\u0440\u0435\u0434\u0430\u043b\u0438 \u0434\u0432\u0430\u00a0int\u00a0\u2013 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0438\u0445 \u0441\u0443\u043c\u043c\u0443 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043f\u0435\u0440\u0432\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0412\u043e\u0442 \u0442\u0430\u043a\u0430\u044f \u0443\u0434\u043e\u0431\u043d\u0430\u044f \u0448\u0442\u0443\u043a\u0430! \u0415\u0449\u0451 \u043e\u0434\u043d\u0438\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u043c \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043e\u043d\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043b\u044e\u0431\u043e\u0433\u043e \u0442\u0438\u043f\u0430, \u0431\u0443\u0434\u0443\u0447\u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0430 \u043e\u0434\u0438\u043d \u0440\u0430\u0437. \u0427\u0438\u0442\u0430\u0439\u0442\u0435 \u043d\u0438\u0436\u0435.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><a href=\"https:\/\/ravesli.com\/urok-102-peregruzka-funktsij\/\">URL \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u21162<\/a><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><a href=\"https:\/\/coderoad.ru\/6434482\/Python-%D0%BF%D0%B5%D1%80%D0%B5%D0%B3%D1%80%D1%83%D0%B7%D0%BA%D0%B0-%D1%84%D1%83%D0%BD%D0%BA%D1%86%D0%B8%D0%B9\">URL \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u21163<\/a><\/p>\n\n\n\n<p><span class=\"has-inline-color has-nv-c-2-color\">\u041d\u0443\u0436\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044e \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0438 \u0438 \u043f\u043e\u0447\u0435\u043c\u0443 \u043e\u043d\u0430 \u043d\u0435\u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c\u0430 \u043a Python.<\/span><\/p>\n\n\n\n<p>\u041f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u044f\u0437\u044b\u043a\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u0442\u044c \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u0432\u044b\u0431\u043e\u0440 \u043c\u0435\u0436\u0434\u0443 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430\u043c\u0438 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438. \u0410\u043a\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u0430\u043a\u0438\u0445 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0434\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u0430 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043e\u0431\u044b\u0447\u043d\u043e \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. (\u00a0<a href=\"http:\/\/en.wikipedia.org\/wiki\/Multiple_dispatch\">\u0412\u0438\u043a\u0438\u043f\u0435\u0434\u0438\u044f<\/a>\u00a0)<\/p>\n\n\n\n<p>Python-\u044d\u0442\u043e&nbsp;<a href=\"https:\/\/pythonconquerstheuniverse.wordpress.com\/2009\/10\/03\/static-vs-dynamic-typing-of-programming-languages\/\">\u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438<\/a>&nbsp;\u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u044f\u0437\u044b\u043a, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u043d\u044f\u0442\u0438\u0435 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0438 \u043a \u043d\u0435\u043c\u0443 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435\u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c\u043e. \u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0449\u0435 \u043d\u0435 \u0432\u0441\u0435 \u043f\u043e\u0442\u0435\u0440\u044f\u043d\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435&nbsp;<em>\u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/em>&nbsp;\u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>\u0412 \u044f\u0437\u044b\u043a\u0430\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e\u0442 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0442\u0438\u043f\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432\u044b\u0431\u043e\u0440\u0430 \u0441\u0440\u0435\u0434\u0438 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u0424\u0443\u043d\u043a\u0446\u0438\u0438, \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u044b\u0431\u0440\u0430\u043d\u044b \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c , \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f&nbsp;<em>\u043c\u0443\u043b\u044c\u0442\u0438\u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438<\/em>&nbsp;. (&nbsp;<a href=\"http:\/\/en.wikipedia.org\/wiki\/Multiple_dispatch\">\u0412\u0438\u043a\u0438\u043f\u0435\u0434\u0438\u044f<\/a>&nbsp;)<\/p><\/blockquote>\n\n\n\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u00a0<em>\u043c\u0443\u043b\u044c\u0442\u0438\u043c\u0435\u0442\u043e\u0434\u044b<\/em>\u00a0\u0432 Python\u2014\u0438\u043b\u0438, \u043a\u0430\u043a \u044d\u0442\u043e \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u043e \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f:\u00a0<em>\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430<\/em>\u00a0.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u041c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u0430\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430<\/h1>\n\n\n\n<p>\u041c\u0443\u043b\u044c\u0442\u0438\u043c\u0435\u0442\u043e\u0434\u044b \u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f&nbsp;<em>\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u043e\u0439<\/em>&nbsp;:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>\u041c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0438\u043b\u0438 \u043c\u0443\u043b\u044c\u0442\u0438\u043c\u0435\u0442\u043e\u0434\u044b-\u044d\u0442\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u044f\u0437\u044b\u043a\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438\u043b\u0438 \u043c\u0435\u0442\u043e\u0434 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u044b \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0442\u0438\u043f\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f (\u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e) \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0435\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432. (&nbsp;<a href=\"http:\/\/en.wikipedia.org\/wiki\/Multiple_dispatch\">\u0412\u0438\u043a\u0438\u043f\u0435\u0434\u0438\u044f<\/a>&nbsp;)<\/p><\/blockquote>\n\n\n\n<p>Python \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u044d\u0442\u043e \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438\u00a0<sup>1<\/sup>\u00a0, \u043d\u043e, \u043a\u0430\u043a \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0435\u0441\u0442\u044c \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442 Python \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c multipledispatch\u00a0<a href=\"https:\/\/pypi.python.org\/pypi\/multipledispatch\/\">,<\/a>\u00a0\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0435\u043b\u0430\u0435\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/h1>\n\n\n\n<p>\u0412\u043e\u0442 \u043a\u0430\u043a \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u043a\u0435\u0442&nbsp;<a href=\"https:\/\/pypi.python.org\/pypi\/multipledispatch\/\">multipledispatch<\/a>&nbsp;<sup>2<\/sup>&nbsp;\u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0430\u0448\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">>>> from multipledispatch import dispatch\n>>> from collections import namedtuple\n>>> from types import *  # we can test for lambda type, e.g.:\n>>> type(lambda a: 1) == LambdaType\nTrue\n\n>>> Sprite = namedtuple('Sprite', ['name'])\n>>> Point = namedtuple('Point', ['x', 'y'])\n>>> Curve = namedtuple('Curve', ['x', 'y', 'z'])\n>>> Vector = namedtuple('Vector', ['x','y','z'])\n\n>>> @dispatch(Sprite, Point, Vector, int)\n... def add_bullet(sprite, start, direction, speed):\n...     print(\"Called Version 1\")\n...\n>>> @dispatch(Sprite, Point, Point, int, float)\n... def add_bullet(sprite, start, headto, speed, acceleration):\n...     print(\"Called version 2\")\n...\n>>> @dispatch(Sprite, LambdaType)\n... def add_bullet(sprite, script):\n...     print(\"Called version 3\")\n...\n>>> @dispatch(Sprite, Curve, int)\n... def add_bullet(sprite, curve, speed):\n...     print(\"Called version 4\")\n...\n\n>>> sprite = Sprite('Turtle')\n>>> start = Point(1,2)\n>>> direction = Vector(1,1,1)\n>>> speed = 100 #km\/h\n>>> acceleration = 5.0 #m\/s\n>>> script = lambda sprite: sprite.x * 2\n>>> curve = Curve(3, 1, 4)\n>>> headto = Point(100, 100) # somewhere far away\n\n>>> add_bullet(sprite, start, direction, speed)\nCalled Version 1\n\n>>> add_bullet(sprite, start, headto, speed, acceleration)\nCalled version 2\n\n>>> add_bullet(sprite, script)\nCalled version 3\n\n>>> add_bullet(sprite, curve, speed)\nCalled version 4<\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>URL \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u21161 \u0412 \u044f\u0437\u044b\u043a\u0435 \u0421++ \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u043e\u043d\u044f\u0442\u0438\u0435 \u041f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 (\u0438\u043b\u0438 \u041f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438) \u041f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u044d\u0442\u043e \u0442\u0430\u043a\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437\u00a0\u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c \u0438\u043c\u0435\u043d\u0435\u043c, \u043d\u043e\u00a0\u0440\u0430\u0437\u043d\u044b\u043c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u043c \u0442\u0438\u043f\u043e\u043c\u00a0\u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u00a0\u0440\u0430\u0437\u043d\u044b\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432. \u0418\u0442\u0430\u043a, \u0443 \u043d\u0430\u0441 \u0442\u0435\u043f\u0435\u0440\u044c \u0446\u0435\u043b\u044b\u0445 \u0442\u0440\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c \u0438\u043c\u0435\u043d\u0435\u043c, \u043d\u043e \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u043d\u0430\u0431\u043e\u0440\u0430\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0438 \u0442\u0438\u043f\u043e\u0432 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430\u00a0\u0441\u0430\u043c\u0430 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u0442\u0441\u044f, \u043a\u0430\u043a\u0443\u044e \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u043d\u0430&hellip;&nbsp;<a href=\"https:\/\/1.cbm.ua\/?p=943\" rel=\"bookmark\">\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 &raquo;<span class=\"screen-reader-text\">??? \u041f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 (C++). \u041c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u0430\u044f \u0438\u043b\u0438 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 (Python-3)<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","footnotes":""},"categories":[2,89],"tags":[],"class_list":["post-943","post","type-post","status-publish","format-standard","hentry","category-python","category-c"],"_links":{"self":[{"href":"https:\/\/1.cbm.ua\/index.php?rest_route=\/wp\/v2\/posts\/943","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/1.cbm.ua\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/1.cbm.ua\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/1.cbm.ua\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/1.cbm.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=943"}],"version-history":[{"count":3,"href":"https:\/\/1.cbm.ua\/index.php?rest_route=\/wp\/v2\/posts\/943\/revisions"}],"predecessor-version":[{"id":3752,"href":"https:\/\/1.cbm.ua\/index.php?rest_route=\/wp\/v2\/posts\/943\/revisions\/3752"}],"wp:attachment":[{"href":"https:\/\/1.cbm.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=943"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/1.cbm.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=943"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/1.cbm.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=943"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}