{"id":293619,"date":"2019-08-20T15:00:28","date_gmt":"2019-08-20T15:00:28","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=293619"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=293619","title":{"rendered":"Python \u043a\u0430\u043a \u043f\u0440\u0435\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 C++. \u0427\u0430\u0441\u0442\u044c 2\/2"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\n<p>\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435. \u041d\u0430\u0447\u0430\u043b\u043e \u0432 \u00ab<a href=\"https:\/\/habr.com\/ru\/post\/464385\/\">Python \u043a\u0430\u043a \u043f\u0440\u0435\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 C++. \u0427\u0430\u0441\u0442\u044c 1\/2<\/a>\u00bb.<\/p>\n<p>  <\/p>\n<h1>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0438 \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445<\/h1>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u0441 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u043e\u0439, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u0432 \u043d\u0430\u0448\u0435\u043c \u044f\u0437\u044b\u043a\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u043e\u0437\u043d\u0430\u0447\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0421++ \u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430 \u0435\u0441\u0442\u044c \u0432\u044b\u0431\u043e\u0440: \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u043c\u044b\u0435 \u0432 \u0441\u0442\u0435\u043a\u0435, \u0438\u043b\u0438 \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u043f\u043e\u043c\u0435\u0449\u0430\u044f \u0432 \u0441\u0442\u0435\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043d\u0430 \u044d\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u0427\u0442\u043e, \u0435\u0441\u043b\u0438 \u043c\u044b \u0432\u044b\u0431\u0435\u0440\u0435\u043c \u0434\u043b\u044f Python \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0443 \u0438\u0437 \u044d\u0442\u0438\u0445 \u043e\u043f\u0446\u0438\u0439?<\/p>\n<p>  <\/p>\n<p>\u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u0442\u0430\u043a \u043a\u0430\u043a \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435 \u043f\u043e\u043c\u0435\u0441\u0442\u044f\u0442\u0441\u044f \u0432 \u0441\u0442\u0435\u043a, \u043b\u0438\u0431\u043e \u0438\u0445 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043f\u043e \u0441\u0442\u0435\u043a\u0443 \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 Python \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438. \u042d\u0442\u043e \u043a\u043e\u043d\u0446\u0435\u043f\u0442\u0443\u0430\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442 \u044f\u0437\u044b\u043a.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">a = 3<\/code><\/pre>\n<p>  <\/p>\n<p>\u0431\u0443\u0434\u0435\u0442 \u043e\u0437\u043d\u0430\u0447\u0430\u0442\u044c \u0442\u043e, \u0447\u0442\u043e \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b (\u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0439 \u00ab\u043a\u0443\u0447\u0435\u00bb) \u043e\u0431\u044a\u0435\u043a\u0442 \u00ab3\u00bb \u0438 \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u0438\u043c\u044f \u201ca\u201d \u0441\u0441\u044b\u043b\u043a\u043e\u0439 \u043d\u0430 \u043d\u0435\u0433\u043e. \u0410 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">b = a<\/code><\/pre>\n<p>  <\/p>\n<p>\u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0437\u043d\u0430\u0447\u0430\u0442\u044c, \u0447\u0442\u043e \u043c\u044b \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u201cb\u201d \u0441\u0441\u044b\u043b\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0442\u043e\u0442 \u0436\u0435 \u043e\u0431\u044a\u0435\u043a\u0442 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f \u201ca\u201d, \u0438\u043d\u0430\u0447\u0435 \u0433\u043e\u0432\u043e\u0440\u044f \u2212 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c.<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0441\u0451 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u043c, \u0442\u043e \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043f\u0438\u0441\u043e\u0447\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043d\u0430\u0448\u0435\u043c \u044f\u0437\u044b\u043a\u0435? \u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u2212 \u0441\u043f\u0438\u0441\u043e\u043a \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439! \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0446\u0435\u043b\u044b\u0445, \u0441\u0442\u0440\u043e\u043a, \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u043f\u0438\u0441\u043a\u043e\u0432, \u0447\u0435\u0433\u043e \u0443\u0433\u043e\u0434\u043d\u043e \u2212 \u0432\u0435\u0434\u044c \u0432\u0441\u0451 \u044d\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438.<\/p>\n<p>  <\/p>\n<p>\u0421\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0438\u043f\u043e\u0432 \u0445\u044d\u0448-\u0442\u0430\u0431\u043b\u0438\u0446 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c? (\u0412 Python \u044d\u0442\u043e\u0442 \u0442\u0438\u043f \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u00ab\u0441\u043b\u043e\u0432\u0430\u0440\u0451\u043c\u00bb \u2212 <code>dict<\/code>.) \u041e\u0434\u0438\u043d! \u041f\u0443\u0441\u0442\u044c \u043e\u043d \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043d\u0430 \u043a\u043b\u044e\u0447\u0438 \u0441 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f\u043c\u0438 \u043d\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0432 \u043d\u0430\u0448\u0435\u043c \u044f\u0437\u044b\u043a\u0430 \u043e\u0433\u0440\u043e\u043c\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 C++ \u2212 \u0448\u0430\u0431\u043b\u043e\u043d\u044b, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432\u0441\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043c\u044b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043c \u043d\u0430\u0434 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438, \u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043f\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044e. \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 Python, \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u043d \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u043e\u0439 \u0441 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f\u043c\u0438: \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432\u0440\u043e\u0434\u0435 NumPy, \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0443\u0447\u0451\u043d\u044b\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0441 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438, \u043a\u0430\u043a \u043e\u043d\u0438 \u0431\u044b \u0434\u0435\u043b\u0430\u043b\u0438 \u044d\u0442\u043e \u0432 Fortran. \u041d\u043e \u043e\u0441\u043d\u043e\u0432\u0430 \u044f\u0437\u044b\u043a\u0430 \u2212 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432\u0440\u043e\u0434\u0435 \u201ca = 3\u201d \u2212 \u0432\u0441\u0435\u0433\u0434\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0441 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f\u043c\u0438.<\/p>\n<p>  <\/p>\n<p>\u041a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f \u00ab\u0432\u0441\u0451 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u043c\u00bb \u0442\u0430\u043a\u0436\u0435 \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0434\u043e \u043f\u0440\u0435\u0434\u0435\u043b\u0430 \u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0446\u0438\u044e \u0442\u0438\u043f\u043e\u0432. \u0425\u043e\u0442\u0438\u0442\u0435 \u0441\u043f\u0438\u0441\u043e\u043a \u0441\u043b\u043e\u0432\u0430\u0440\u0435\u0439? \u041f\u0440\u043e\u0441\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0441\u043f\u0438\u0441\u043e\u043a \u0438 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u0435 \u0442\u0443\u0434\u0430 \u0441\u043b\u043e\u0432\u0430\u0440\u0438! \u041d\u0435 \u043d\u0443\u0436\u043d\u043e \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c \u0443 Python \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0442\u0438\u043f\u044b, \u0432\u0441\u0451 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u00ab\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438\u00bb.<\/p>\n<p>  <\/p>\n<p>\u0410 \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0441\u0442\u0430\u0432\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043b\u044e\u0447\u0435\u0439? \u041a\u043b\u044e\u0447 \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u043c\u0435\u0442\u044c \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0438\u043d\u0430\u0447\u0435 \u043a\u0430\u043a \u0438\u0441\u043a\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u043d\u0435\u043c\u0443? \u0421\u043f\u0438\u0441\u043a\u0438 \u043c\u043e\u0433\u0443\u0442 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0445 \u043d\u0435\u043b\u044c\u0437\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435. \u0414\u043b\u044f \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0439 \u0432 Python \u0435\u0441\u0442\u044c \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0439, \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0441\u043f\u0438\u0441\u043a\u0443, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u043d\u043e, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0441\u043f\u0438\u0441\u043a\u0430, \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u044d\u0442\u0430 \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f. \u042d\u0442\u043e\u0442 \u0442\u0438\u043f \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u0440\u0442\u0435\u0436 \u0438\u043b\u0438 <code>tuple<\/code> (\u043f\u0440\u043e\u0438\u0437\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a\u0430\u043a \u00ab\u0442\u044c\u044e\u043f\u043b\u00bb \u0438\u043b\u0438 \u00ab\u0442\u0430\u043f\u043b\u00bb).<\/p>\n<p>  <\/p>\n<p>\u041a\u043e\u0440\u0442\u0435\u0436\u0438 \u0432 Python \u0440\u0435\u0448\u0430\u044e\u0442 \u0434\u0430\u0432\u043d\u044e\u044e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432\u044b\u0445 \u044f\u0437\u044b\u043a\u043e\u0432. \u0415\u0441\u043b\u0438 \u0432\u0430\u0441 \u043d\u0435 \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u044f\u0435\u0442 \u044d\u0442\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c, \u0442\u043e \u0432\u044b, \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u043f\u044b\u0442\u0430\u043b\u0438\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0441\u0435\u0440\u044c\u0451\u0437\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432\u044b\u0435 \u044f\u0437\u044b\u043a\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043a\u043b\u044e\u0447\u0430 \u0432 \u0445\u044d\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u0430\u0445 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u043e\u043a\u0438 \u0438\u043b\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u0435 \u0442\u0438\u043f\u044b.<\/p>\n<p>  <\/p>\n<p>\u0414\u0440\u0443\u0433\u0430\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0434\u0430\u044e\u0442 \u043d\u0430\u043c \u043a\u043e\u0440\u0442\u0435\u0436\u0438 \u2212 \u0432\u043e\u0437\u0432\u0440\u0430\u0442 \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0431\u0435\u0437 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0442\u044c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u0430\u043a \u044d\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u0435\u043b\u0430\u0442\u044c \u0432 C \u0438 C++. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u043f\u0440\u043e\u0449\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e, \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u044f \u0431\u044b\u043b \u043d\u0430\u0434\u0435\u043b\u0451\u043d \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u043a\u043e\u0440\u0442\u0435\u0436\u0438 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435.<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">def get_address():     ...     return host, port  host, port = get_address()<\/code><\/pre>\n<p>  <\/p>\n<p>\u0423 \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u043a\u0438 \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u043f\u043e\u0431\u043e\u0447\u043d\u044b\u0445 \u044d\u0444\u0444\u0435\u043a\u0442\u043e\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0431\u043c\u0435\u043d \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">x, y = y, x<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u0441\u0451 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u043c, \u0437\u043d\u0430\u0447\u0438\u0442, \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u0434\u0430\u043d\u043d\u044b\u0435. \u0415\u0441\u043b\u0438 \u0432\u044b \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u0441 \u043a\u043d\u0438\u0433\u043e\u0439 \u00ab\u041f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f\u00bb \u0437\u0430 \u0430\u0432\u0442\u043e\u0440\u0441\u0442\u0432\u043e\u043c \u00ab\u0411\u0430\u043d\u0434\u044b \u0447\u0435\u0442\u044b\u0440\u0451\u0445\u00bb, \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u043a\u0430\u043a\u0438\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0438 \u0437\u0430\u043f\u0443\u0442\u0430\u043d\u043d\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u043e\u043d\u0430 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u0431\u043e\u0440 \u0442\u0438\u043f\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0432\u0430\u0448\u0435\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043e\u0439 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u044f\u0437\u044b\u043a\u0430\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u044d\u0442\u043e \u0441\u043b\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c! \u0412 Python \u0432\u0441\u0435 \u044d\u0442\u0438 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0443\u043b\u0435\u0442\u0443\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u044b \u0437\u043d\u0430\u0435\u043c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445, \u0447\u0442\u043e \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0438 \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u2212 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0441\u044b\u043b\u043a\u0438, \u0430 \u0441\u0441\u044b\u043b\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u044f\u0445. \u042d\u0442\u043e \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0437\u0430\u0434\u0430\u0447\u0443 \u0434\u043e \u043f\u0440\u0435\u0434\u0435\u043b\u0430.<\/p>\n<p>  <\/p>\n<p>\u0414\u044d\u0432\u0438\u0434 \u0412\u0438\u043b\u0435\u0440 \u0433\u043e\u0432\u043e\u0440\u0438\u043b: \u00ab\u0412\u0441\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0440\u0435\u0448\u0430\u044e\u0442\u0441\u044f \u043f\u0443\u0442\u0451\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u043a\u043e\u0441\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438\u00bb. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0441\u044b\u043b\u043e\u043a \u0432 Python \u2212 \u044d\u0442\u043e \u0442\u043e\u0442 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043a\u043e\u0441\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u044f\u0437\u044b\u043a\u0430\u0445, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u0432 C++. \u041d\u043e \u0435\u0441\u043b\u0438 \u0442\u0430\u043c \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u044f\u0432\u043d\u043e, \u0438 \u044d\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0443\u0441\u043b\u043e\u0436\u043d\u0435\u043d\u0438\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c, \u0442\u043e \u0432 Python \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0435\u044f\u0432\u043d\u043e, \u0435\u0434\u0438\u043d\u043e\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e \u0432 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u0441\u0435\u0445 \u0442\u0438\u043f\u043e\u0432, \u0438 \u0434\u0440\u0443\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e.<\/p>\n<p>  <\/p>\n<p>\u041d\u043e \u0435\u0441\u043b\u0438 \u0432\u0441\u0451 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0441\u044b\u043b\u043a\u0430\u043c\u0438, \u0442\u043e \u043d\u0430 \u0447\u0442\u043e \u0441\u0441\u044b\u043b\u0430\u044e\u0442\u0441\u044f \u044d\u0442\u0438 \u0441\u0441\u044b\u043b\u043a\u0438? \u0412 \u044f\u0437\u044b\u043a\u0430\u0445 \u0432\u0440\u043e\u0434\u0435 C++ \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0442\u0438\u043f\u043e\u0432. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0432 Python \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445 \u2212 \u043e\u0431\u044a\u0435\u043a\u0442! \u0421\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u044b \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0442\u0435\u043e\u0440\u0438\u0438 \u0442\u0438\u043f\u043e\u0432 \u043d\u0435\u043e\u0434\u043e\u0431\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a\u0430\u0447\u0430\u044e\u0442 \u0433\u043e\u043b\u043e\u0432\u0430\u043c\u0438, \u043d\u043e \u044f \u0441\u0447\u0438\u0442\u0430\u044e, \u0447\u0442\u043e \u043e\u0434\u0438\u043d \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445, \u043e\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0432 \u044f\u0437\u044b\u043a\u0435 \u2212 \u044d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u0430\u044f \u0438\u0434\u0435\u044f, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0449\u0430\u044f \u0435\u0434\u0438\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e\u0441\u0442\u044c \u044f\u0437\u044b\u043a\u0430 \u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0443 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<p>\u0427\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u043f\u0430\u043c\u044f\u0442\u0438, \u0442\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 Python (PyPy, Jython \u0438\u043b\u0438 MicroPython) \u043c\u043e\u0433\u0443\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u043f\u043e-\u0440\u0430\u0437\u043d\u043e\u043c\u0443. \u041d\u043e, \u0447\u0442\u043e\u0431\u044b \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0430 \u0438 \u0435\u0434\u0438\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e\u0441\u0442\u044c Python, \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0443\u044e \u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c, \u043b\u0443\u0447\u0448\u0435 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u044d\u0442\u0430\u043b\u043e\u043d\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 Python \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 C, \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0439 CPython, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 <a href=\"https:\/\/python.org\/\">python.org<\/a>.<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">struct {     struct _typeobject *ob_type;     \/* followed by object\u2019s data *\/ }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u043e, \u0447\u0442\u043e \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c \u043a\u043e\u0434\u0435 CPython \u2212 \u044d\u0442\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0442\u0438\u043f\u0435 \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0438 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439.<\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0436\u0435 \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0442\u0438\u043f\u0435? \u0421\u043d\u043e\u0432\u0430 \u0443\u0433\u043b\u0443\u0431\u0438\u043c\u0441\u044f \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 CPython.<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">struct _typeobject {     \/* ... *\/     getattrfunc tp_getattr;     setattrfunc tp_setattr;     \/* ... *\/     newfunc tp_new;     freefunc tp_free;     \/* ... *\/     binaryfunc nb_add;     binaryfunc nb_subtract;     \/* ... *\/     richcmpfunc tp_richcompare;     \/* ... *\/ }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041c\u044b \u0432\u0438\u0434\u0438\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430: \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0432\u044b\u0447\u0438\u0442\u0430\u043d\u0438\u0435, \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435, \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c, \u0438\u043d\u0434\u0435\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u0441\u043b\u0430\u0439\u0441\u0438\u043d\u0433 \u0438 \u0442. \u0434. \u042d\u0442\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0437\u043d\u0430\u044e\u0442, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0430 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0438\u0436\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0442\u0438\u043f\u0435, \u0431\u0443\u0434\u044c \u0442\u043e \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e, \u0441\u0442\u0440\u043e\u043a\u0430 \u0438\u043b\u0438 \u043e\u0431\u044a\u0435\u043a\u0442 \u0442\u0438\u043f\u0430, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c.<\/p>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u0440\u0430\u0434\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 C \u0438 C++, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0442\u0438\u043f\u0435 \u0430\u0441\u0441\u043e\u0446\u0438\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441 \u0438\u043c\u0435\u043d\u0430\u043c\u0438, \u0430 \u043d\u0435 \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445. \u0412 Python \u0432\u0441\u0435 \u0438\u043c\u0435\u043d\u0430 \u0430\u0441\u0441\u043e\u0446\u0438\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0441\u043e \u0441\u0441\u044b\u043b\u043a\u0430\u043c\u0438. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0438\u043c\u0435\u0435\u0442 \u0442\u0438\u043f. \u0412 \u044d\u0442\u043e\u043c \u0438 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0441\u0443\u0442\u044c \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u044f\u0437\u044b\u043a\u043e\u0432.<\/p>\n<p>  <\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u044f\u0437\u044b\u043a\u0430, \u043d\u0430\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0434\u0432\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0430\u0434 \u0441\u0441\u044b\u043b\u043a\u0430\u043c\u0438. \u041e\u0434\u043d\u0430 \u0438\u0437 \u043d\u0438\u0445 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u0430 \u2212 \u044d\u0442\u043e \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435. \u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043d\u043e\u0439, \u0441\u043b\u043e\u0442\u0443 \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u0435 \u0438\u043b\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u043c\u044b \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0441\u0441\u044b\u043b\u043a\u0438. \u042d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u0430\u044f, \u0431\u044b\u0441\u0442\u0440\u0430\u044f \u0438 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f: \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0441\u044b\u043b\u043e\u043a \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430.<\/p>\n<p>  <\/p>\n<p>\u0412\u0442\u043e\u0440\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u2212 \u044d\u0442\u043e \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u043b\u0438 \u043c\u0435\u0442\u043e\u0434\u0430. \u041a\u0430\u043a \u043c\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438 \u0432\u044b\u0448\u0435, \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043d\u0430 Python \u043c\u043e\u0436\u0435\u0442 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0432\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u0445. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043d\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u0443\u044e \u0441 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435\u043c \u043a \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<p>  <\/p>\n<p>\u0423 \u0432\u0430\u0441 \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441: \u0435\u0441\u043b\u0438 \u0432\u0441\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0441\u0441\u044b\u043b\u043a\u0438, \u0442\u043e \u043a\u0430\u043a \u044f \u043c\u043e\u0433\u0443 \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c \u043e\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u043f\u0435\u0440\u0435\u0434\u0430\u0432 \u0435\u0451 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043a\u0430\u043a \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440?<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">n = 3 some_function(n) # Q: I just passed a pointer! # Could some_function() have changed \u201c3\u201d?<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0442\u0432\u0435\u0442 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0442\u0438\u043f\u044b \u0432 Python \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u043c\u0438: \u0432 \u043d\u0438\u0445 \u043f\u043e\u043f\u0440\u043e\u0441\u0442\u0443 \u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u041d\u0435\u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0435 (\u0438\u043c\u043c\u0443\u0442\u0430\u0431\u0435\u043b\u044c\u043d\u044b\u0435) <code>int<\/code>, <code>float<\/code>, <code>tuple<\/code> \u0438\u043b\u0438 <code>str<\/code> \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0442 \u0432 \u044f\u0437\u044b\u043a\u0430\u0445 \u0442\u0438\u043f\u0430 \u00ab\u0432\u0441\u0451 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u043c\u00bb \u0442\u043e\u0442 \u0436\u0435 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u044d\u0444\u0444\u0435\u043a\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 C \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435.<\/p>\n<p>  <\/p>\n<p>\u0423\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0449\u0430\u044e\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043e\u0431\u043e\u0431\u0449\u0451\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0438\u043b\u0438 \u0434\u0436\u0435\u043d\u0435\u0440\u0438\u043a\u043e\u0432. \u0424\u0443\u043d\u043a\u0446\u0438\u0438 <code>min()<\/code>, <code>max()<\/code>, <code>sum()<\/code> \u0438 \u0438\u043c \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u043c\u0438, \u043d\u0435\u0442 \u043d\u0443\u0436\u0434\u044b \u0438\u0445 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u0418 \u043e\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0441 \u043b\u044e\u0431\u044b\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0434\u043b\u044f <code>min()<\/code> \u0438 <code>max()<\/code>, \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f <code>sum()<\/code> \u0438 \u0442. \u0434.<\/p>\n<p>  <\/p>\n<h1>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432<\/h1>\n<p>  <\/p>\n<p>\u041c\u044b \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u0438 \u0432 \u043e\u0431\u0449\u0438\u0445 \u0447\u0435\u0440\u0442\u0430\u0445, \u043a\u0430\u043a \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u0435\u0441\u0442\u0438 \u0441\u0435\u0431\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u044b. \u0422\u0435\u043f\u0435\u0440\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c, \u043a\u0430\u043a \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0445 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c. \u042d\u0442\u043e \u2212 \u0432\u043e\u043f\u0440\u043e\u0441 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 \u044f\u0437\u044b\u043a\u0430. C++ \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0442\u0440\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430:<\/p>\n<p>  <\/p>\n<ol>\n<li>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439, \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430:<br \/> \n<pre><code class=\"cpp\">my_class c(arg);<\/code><\/pre>\n<\/li>\n<li>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <code>new<\/code>:<br \/> \n<pre><code class=\"cpp\">my_class *c = new my_class(arg);<\/code><\/pre>\n<\/li>\n<li>\u0424\u0430\u0431\u0440\u0438\u0447\u043d\u044b\u0439, \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0432\u044b\u0437\u043e\u0432\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0435\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c:<br \/> \n<pre><code class=\"cpp\">my_class *c = my_factory(arg);<\/code><\/pre>\n<\/li>\n<\/ol>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0432\u044b \u0443\u0436\u0435, \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u0434\u043e\u0433\u0430\u0434\u0430\u043b\u0438\u0441\u044c, \u0438\u0437\u0443\u0447\u0438\u0432 \u0441\u043f\u043e\u0441\u043e\u0431 \u043c\u044b\u0448\u043b\u0435\u043d\u0438\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u0435\u0439 Python \u043d\u0430 \u0432\u044b\u0448\u0435\u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445, \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0438\u0437 \u043d\u0438\u0445.<\/p>\n<p>  <\/p>\n<p>\u0418\u0437 \u0442\u043e\u0439 \u0436\u0435 \u043a\u043d\u0438\u0433\u0438 \u00ab\u0411\u0430\u043d\u0434\u044b \u0447\u0435\u0442\u044b\u0440\u0451\u0445\u00bb \u043c\u044b \u0443\u0437\u043d\u0430\u043b\u0438, \u0447\u0442\u043e \u0444\u0430\u0431\u0440\u0438\u043a\u0430 \u2212 \u044d\u0442\u043e \u0441\u0430\u043c\u044b\u0439 \u0433\u0438\u0431\u043a\u0438\u0439 \u0438 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 Python \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u043e\u0442 \u0441\u043f\u043e\u0441\u043e\u0431.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u043c\u0438\u043c\u043e \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u044d\u0442\u043e\u0442 \u0441\u043f\u043e\u0441\u043e\u0431 \u0445\u043e\u0440\u043e\u0448 \u0442\u0435\u043c, \u0447\u0442\u043e \u0434\u043b\u044f \u0435\u0433\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u044f\u0437\u044b\u043a \u043b\u0438\u0448\u043d\u0438\u043c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u043e\u043c: \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0443\u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0432 \u043d\u0430\u0448\u0435\u043c \u044f\u0437\u044b\u043a\u0435, \u0430 \u0444\u0430\u0431\u0440\u0438\u043a\u0430 \u2212 \u044d\u0442\u043e \u043d\u0435 \u0447\u0442\u043e \u0438\u043d\u043e\u0435, \u043a\u0430\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u044f.<\/p>\n<p>  <\/p>\n<p>\u0414\u0440\u0443\u0433\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0432 Python \u0442\u0430\u043a\u043e\u0432\u043e: \u043b\u044e\u0431\u043e\u0439 \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0444\u0430\u0431\u0440\u0438\u043a\u043e\u0439. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0433\u043e\u0434\u043d\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445, \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0445 \u0444\u0430\u0431\u0440\u0438\u043a (\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043e\u0431\u044b\u0447\u043d\u044b\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u0438\u043b\u0438 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435), \u043d\u043e \u043e\u0431\u0449\u0435\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0432 \u0441\u0438\u043b\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\"># Let\u2019s make type objects # their own type\u2019s factories! c = MyClass() i = int('7') f = float(length) s = str(bytes)<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u0441\u0435 \u0442\u0438\u043f\u044b \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u043c\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438, \u0438 \u0432\u0441\u0435 \u043e\u043d\u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u0432\u043e\u0435\u0433\u043e \u0442\u0438\u043f\u0430, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438, \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435.<\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 \u044f\u0437\u044b\u043a\u0430, \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u043b\u044e\u0431\u044b\u0435 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438 \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0432\u0440\u043e\u0434\u0435 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432 \u00ab\u0410\u0440\u0435\u043d\u0430\u00bb \u0438\u043b\u0438 \u00ab\u041f\u0440\u0438\u0441\u043f\u043e\u0441\u043e\u0431\u043b\u0435\u043d\u0435\u0446\u00bb, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0435\u0449\u0451 \u043e\u0434\u043d\u0430 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0438\u0434\u0435\u044f, \u043f\u043e\u0437\u0430\u0438\u043c\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0438\u0437 C++, \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0442\u0438\u043f \u0441\u0430\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442, \u043a\u0430\u043a \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u0440\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0435\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u043a\u0430\u043a \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <code>new<\/code> \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u043b\u044f \u043d\u0435\u0433\u043e.<\/p>\n<p>  <\/p>\n<h1>\u041a\u0430\u043a \u043d\u0430\u0441\u0447\u0451\u0442 NULL?<\/h1>\n<p>  <\/p>\n<p>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043f\u0443\u0441\u0442\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438, \u0442\u0430\u043a \u0447\u0442\u043e \u043c\u044b \u043e\u0431\u044a\u044f\u0432\u0438\u043c NULL \u0432\u043d\u0435 \u0437\u0430\u043a\u043e\u043d\u0430. \u0421\u0438\u043d\u0442\u0430\u043a\u0441 Python \u043d\u0435 \u0434\u0430\u0451\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c. \u0414\u0432\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0440\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0430\u0434 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f\u043c\u0438, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u043b\u0438 \u0440\u0430\u043d\u0435\u0435, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e \u043b\u044e\u0431\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043e\u0431\u044a\u0435\u043a\u0442.<\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 \u044d\u0442\u043e\u0433\u043e, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 \u044f\u0437\u044b\u043a\u0430 Python \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u0443\u044e \u0441 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435\u043c \u043a \u043f\u0430\u043c\u044f\u0442\u0438, \u0442\u0438\u043f\u0430 \u043e\u0448\u0438\u0431\u043a\u0438 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0438\u043b\u0438 \u0432\u044b\u0445\u043e\u0434\u0430 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u044b \u0431\u0443\u0444\u0435\u0440\u0430. \u0418\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043d\u0430 Python \u043d\u0435 \u043f\u043e\u0434\u0432\u0435\u0440\u0436\u0435\u043d\u044b \u0434\u0432\u0443\u043c \u0441\u0430\u043c\u044b\u043c \u043e\u043f\u0430\u0441\u043d\u044b\u043c \u0442\u0438\u043f\u0430\u043c \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0433\u0440\u043e\u0436\u0430\u044e\u0442 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 20 \u043b\u0435\u0442.<\/p>\n<p>  <\/p>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043f\u0440\u043e\u0441\u0438\u0442\u044c: \u00ab\u0415\u0441\u043b\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u043d\u0430\u0434 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u043d\u0430, \u043a\u0430\u043a \u043c\u044b \u0432\u0438\u0434\u0435\u043b\u0438 \u0440\u0430\u043d\u0435\u0435, \u0442\u043e \u043a\u0430\u043a \u0436\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b, \u0441 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 \u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438, \u043d\u0435 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435?\u00bb<\/p>\n<p>  <\/p>\n<p>\u041c\u0430\u0433\u0438\u044f \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 Python \u0438\u043c\u0435\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u00ab\u0437\u0430\u0433\u043e\u0442\u043e\u0432\u043a\u0443\u00bb \u0441 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0447\u0438\u0441\u043b\u043e\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432. \u0412\u043e\u0442 \u0441\u0430\u043c\u044b\u0435 \u0432\u0430\u0436\u043d\u044b\u0435 \u0438\u0437 \u043d\u0438\u0445:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">struct _typeobject {     getattrfunc tr_getattr;     setattrfunc tr_setattr;     \/* ... *\/     newfunc tp_new;     \/* ... *\/ }<\/code><\/pre>\n<p>  <\/p>\n<p><code>tp_new()<\/code> \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0445\u044d\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u0443, \u0442\u0430\u043a\u0443\u044e \u0436\u0435, \u043a\u0430\u043a \u0434\u043b\u044f \u0442\u0438\u043f\u0430 <code>dict<\/code>. <code>tp_getattr()<\/code> \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u0447\u0442\u043e-\u0442\u043e \u0438\u0437 \u044d\u0442\u043e\u0439 \u0445\u044d\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0430 <code>tp_setattr()<\/code>, \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442, \u0447\u0442\u043e-\u0442\u043e \u0442\u0443\u0434\u0430 \u043a\u043b\u0430\u0434\u0451\u0442. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0435 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u044f\u0437\u044b\u043a\u0430 C, \u0430 \u0443\u0440\u043e\u0432\u043d\u0435\u043c \u0432\u044b\u0448\u0435 \u2212 \u0445\u044d\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u0435\u0439. (\u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.)<\/p>\n<p>  <\/p>\n<h1>\u041c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u0434\u043e\u0441\u0442\u0443\u043f\u0430<\/h1>\n<p>  <\/p>\n<p>\u0427\u0442\u043e \u0436\u0435 \u043d\u0430\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0442\u0435\u043c\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c\u0438 \u0438 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432 C++ \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u0432\u043e\u043a\u0440\u0443\u0433 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u0441\u043b\u043e\u0432 <code>private<\/code> \u0438 <code>protected<\/code>? Python, \u0431\u0443\u0434\u0443\u0447\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432\u044b\u043c \u044f\u0437\u044b\u043a\u043e\u043c, \u043d\u0435 \u043d\u0443\u0436\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u043d\u0438\u0445. \u0423 \u043d\u0430\u0441 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u00ab\u0437\u0430\u0449\u0438\u0449\u0451\u043d\u043d\u044b\u0435\u00bb \u0447\u0430\u0441\u0442\u0438 \u044f\u0437\u044b\u043a\u0430 \u2212 \u044d\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432. \u041d\u0438 \u043f\u0440\u0438 \u043a\u0430\u043a\u0438\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 Python \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u0442\u0430\u043c\u0438 \u0447\u0438\u0441\u043b\u0430 \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0437\u0430\u043f\u044f\u0442\u043e\u0439! \u042d\u0442\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u044f\u0446\u0438\u0438 \u0432\u043f\u043e\u043b\u043d\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0446\u0435\u043b\u043e\u0441\u0442\u043d\u043e\u0441\u0442\u044c \u0441\u0430\u043c\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430. \u041c\u044b, \u0441\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u0438 Python, \u0441\u0447\u0438\u0442\u0430\u0435\u043c, \u0447\u0442\u043e \u0446\u0435\u043b\u043e\u0441\u0442\u043d\u043e\u0441\u0442\u044c \u044f\u0437\u044b\u043a\u0430 \u2212 \u044d\u0442\u043e \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u043f\u0440\u0435\u0434\u043b\u043e\u0433 \u0434\u043b\u044f \u0441\u043e\u043a\u0440\u044b\u0442\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u0412\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0441\u0447\u0438\u0442\u0430\u044e\u0442\u0441\u044f \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u043c\u0438.<\/p>\n<p>  <\/p>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b \u043f\u043e\u0434\u0447\u0451\u0440\u043a\u0438\u0432\u0430\u043d\u0438\u044f (<code>_<\/code>) \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0438\u043c\u0435\u043d\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 \u043a\u043b\u0430\u0441\u0441\u0430, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0434\u0438\u0442\u044c \u043a\u043e\u043b\u043b\u0435\u0433\u0443: \u043d\u0430 \u044d\u0442\u043e\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f. \u041d\u043e \u0432 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u043c Python \u0432\u044b\u0443\u0447\u0438\u043b \u0443\u0440\u043e\u043a\u0438 \u043d\u0430\u0447\u0430\u043b\u0430 90-\u0445: \u0442\u043e\u0433\u0434\u0430 \u043c\u043d\u043e\u0433\u0438\u0435 \u0432\u0435\u0440\u0438\u043b\u0438 \u0432 \u0442\u043e, \u0447\u0442\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u043e\u0439 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043c\u044b \u043f\u0438\u0448\u0435\u043c \u0440\u0430\u0437\u0434\u0443\u0442\u044b\u0435, \u043d\u0435\u0447\u0438\u0442\u0430\u0435\u043c\u044b\u0435 \u0438 \u0437\u0430\u0431\u0430\u0433\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445. \u0414\u0443\u043c\u0430\u044e, \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 20 \u043b\u0435\u0442 \u0443\u0431\u0435\u0434\u0438\u043b\u0438 \u0432\u0441\u0435\u0445 \u0432 \u0438\u043d\u0434\u0443\u0441\u0442\u0440\u0438\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f: \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u2212 \u044d\u0442\u043e \u043d\u0435 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435, \u0438 \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0441\u0430\u043c\u043e\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e \u043e\u0442 \u0440\u0430\u0437\u0434\u0443\u0442\u044b\u0445 \u0438 \u0437\u0430\u0431\u0430\u0433\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u0438 Python \u0440\u0435\u0448\u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u043d\u0435 \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u0438\u0442\u044c\u0441\u044f \u043f\u043e \u043f\u043e\u0432\u043e\u0434\u0443 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u0438, \u043a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u043d\u0435 \u043f\u0440\u043e\u0433\u0430\u0434\u0430\u043b\u0438.<\/p>\n<p>  <\/p>\n<h1>\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u044c\u044e<\/h1>\n<p>  <\/p>\n<p>\u0427\u0442\u043e \u0436\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441 \u043d\u0430\u0448\u0438\u043c\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438, \u0447\u0438\u0441\u043b\u0430\u043c\u0438 \u0438 \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438 \u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u043d\u0438\u0437\u043a\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435? \u041a\u0430\u043a \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u043d\u0438 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u044e\u0442\u0441\u044f \u0432 \u043f\u0430\u043c\u044f\u0442\u0438, \u043a\u0430\u043a CPython \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043d\u0438\u043c, \u043a\u043e\u0433\u0434\u0430 \u0438 \u043f\u0440\u0438 \u043a\u0430\u043a\u0438\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 \u043e\u043d\u0438 \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0430\u044e\u0442\u0441\u044f?<\/p>\n<p>  <\/p>\n<p>\u0418 \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u0432\u044b\u0431\u0440\u0430\u043b\u0438 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043e\u0431\u0449\u0438\u0439, \u043f\u0440\u0435\u0434\u0441\u043a\u0430\u0437\u0443\u0435\u043c\u044b\u0439 \u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u0430\u043c\u044f\u0442\u044c\u044e: \u0441\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u044b C-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0432\u0441\u0435 \u043d\u0430\u0448\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u2212 \u044d\u0442\u043e <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/memory\/shared_ptr\">\u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438<\/a>.<\/p>\n<p>  <\/p>\n<p>\u0421 \u0443\u0447\u0451\u0442\u043e\u043c \u044d\u0442\u043e\u0433\u043e \u0437\u043d\u0430\u043d\u0438\u044f \u0442\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u0440\u0430\u043d\u0435\u0435, \u0432 \u0447\u0430\u0441\u0442\u0438 \u00ab\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0438 \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445\u00bb, \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">struct {     Py_ssize_t ob_refcnt;     struct {        struct _typeobject *ob_type;         \/* followed by object\u2019s data *\/     } }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418\u0442\u0430\u043a, \u043a\u0430\u0436\u0434\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0432 Python (\u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0432 \u0432\u0438\u0434\u0443 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e CPython, \u0440\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f) \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u0439 \u0441\u0447\u0451\u0442\u0447\u0438\u043a \u0441\u0441\u044b\u043b\u043e\u043a. \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043d \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0440\u0430\u0432\u043d\u044b\u043c \u043d\u0443\u043b\u044e, \u043e\u0431\u044a\u0435\u043a\u0442 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0443\u0434\u0430\u043b\u0451\u043d.<\/p>\n<p>  <\/p>\n<p>\u041c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043f\u043e\u0434\u0441\u0447\u0451\u0442\u0430 \u0441\u0441\u044b\u043b\u043e\u043a \u043d\u0435 \u043e\u043f\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u0444\u043e\u043d\u043e\u0432\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u2212 \u043e\u0431\u044a\u0435\u043a\u0442 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0435\u043d \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043e\u043d \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0432\u044b\u0441\u043e\u043a\u0443\u044e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445: \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c \u0441\u043d\u043e\u0432\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u044f. \u0422\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442, \u043d\u0430\u0445\u043e\u0434\u0438\u043b\u0441\u044f \u0432 \u043a\u044d\u0448\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0432 \u043a\u044d\u0448\u0435. \u042d\u0442\u0438 \u0434\u0432\u0430 \u0444\u0430\u043a\u0442\u043e\u0440\u0430 \u2212 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0430 \u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u2212 \u0434\u0435\u043b\u0430\u044e\u0442 \u043f\u043e\u0434\u0441\u0447\u0451\u0442 \u0441\u0441\u044b\u043b\u043e\u043a \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u0441\u0431\u043e\u0440\u043a\u0438 \u043c\u0443\u0441\u043e\u0440\u0430.<\/p>\n<p>  <\/p>\n<p>(\u0418\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430\u0445 \u043d\u0435\u0440\u0435\u0434\u043a\u043e \u0441\u0441\u044b\u043b\u0430\u044e\u0442\u0441\u044f \u0434\u0440\u0443\u0433 \u043d\u0430 \u0434\u0440\u0443\u0433\u0430, \u0441\u0447\u0451\u0442\u0447\u0438\u043a \u0441\u0441\u044b\u043b\u043e\u043a \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c\u0441\u044f \u0434\u043e \u043d\u0443\u043b\u044f, \u0434\u0430\u0436\u0435 \u043a\u043e\u0433\u0434\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 CPython \u0435\u0441\u0442\u044c \u0438 \u0432\u0442\u043e\u0440\u043e\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0441\u0431\u043e\u0440\u0430 \u043c\u0443\u0441\u043e\u0440\u0430 \u2212 \u0444\u043e\u043d\u043e\u0432\u044b\u0439, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 \u043f\u043e\u043a\u043e\u043b\u0435\u043d\u0438\u044f\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. \u2212 <em>\u043f\u0440\u0438\u043c. \u043f\u0435\u0440\u0435\u0432.<\/em>)<\/p>\n<p>  <\/p>\n<h1>\u041e\u0448\u0438\u0431\u043a\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 Python<\/h1>\n<p>  <\/p>\n<p>\u041c\u044b \u0441\u0442\u0430\u0440\u0430\u043b\u0438\u0441\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u044f\u0437\u044b\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442 \u0434\u043b\u044f \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u0432, \u043d\u043e \u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u0438\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u0435\u043d \u0434\u043b\u044f \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u043e\u043d\u0430\u043b\u043e\u0432. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0430\u043c \u043d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043e\u043a \u0432 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0438 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0441\u0430\u043c\u0438 \u0438 \u0441\u043e\u0437\u0434\u0430\u043b\u0438.<\/p>\n<p>  <\/p>\n<p>Python 2 \u0438\u0437-\u0437\u0430 \u0438\u043d\u0435\u0440\u0446\u0438\u0438 \u043c\u044b\u0448\u043b\u0435\u043d\u0438\u044f, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0439 \u0441\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432\u044b\u043c\u0438 \u044f\u0437\u044b\u043a\u0430\u043c\u0438, \u043f\u044b\u0442\u0430\u043b\u0441\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0435 \u0442\u0438\u043f\u044b, \u043a\u0430\u043a \u0434\u0435\u043b\u0430\u043b \u0431\u044b \u044d\u0442\u043e \u044f\u0437\u044b\u043a \u0441 \u043d\u0435\u0441\u0442\u0440\u043e\u0433\u043e\u0439 \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u0435\u0439. \u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u043e\u043f\u044b\u0442\u0430\u0435\u0442\u0435\u0441\u044c \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0431\u0430\u0439\u0442\u043e\u0432\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u043e\u0439 \u0432 Unicode, \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440 \u043d\u0435\u044f\u0432\u043d\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0431\u0430\u0439\u0442\u043e\u0432\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0432 Unicode \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0442\u043e\u0439 \u043a\u043e\u0434\u043e\u0432\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 Unicode:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">&gt;&gt;&gt; 'byte string ' + u'unicode string' u'byte string unicode string'<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0435\u0431-\u0441\u0430\u0439\u0442\u044b \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438, \u043f\u043e\u043a\u0430 \u0438\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u0439 \u044f\u0437\u044b\u043a, \u043d\u043e \u0432\u044b\u0434\u0430\u0432\u0430\u043b\u0438 \u0437\u0430\u0433\u0430\u0434\u043e\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0430\u043b\u0444\u0430\u0432\u0438\u0442\u043e\u0432.<\/p>\n<p>  <\/p>\n<p>\u042d\u0442\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u044f\u0437\u044b\u043a\u0430 \u0431\u044b\u043b\u0430 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0430 \u0432 Python 3:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">&gt;&gt;&gt; b'byte string ' + u'unicode string' TypeError: can't concat bytes to str<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u0445\u043e\u0436\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u0432 Python 2 \u0431\u044b\u043b\u0430 \u0441\u0432\u044f\u0437\u0430\u043d\u0430 \u0441 \u00ab\u043d\u0430\u0438\u0432\u043d\u043e\u0439\u00bb \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u043e\u0439 \u0441\u043f\u0438\u0441\u043a\u043e\u0432, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0438\u0445 \u0438\u0437 \u043d\u0435\u0441\u0440\u0430\u0432\u043d\u0438\u043c\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">&gt;&gt;&gt; sorted(['b', 1, 'a', 2]) [1, 2, 'a', 'b']<\/code><\/pre>\n<p>  <\/p>\n<p>Python 3 \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u0430\u0451\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u0442\u043e\u0442 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043d\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043e\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u043e\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">&gt;&gt;&gt; sorted(['b', 1, 'a', 2]) TypeError: unorderable types: int() &lt; str()<\/code><\/pre>\n<p>  <\/p>\n<h1>\u0417\u043b\u043e\u0443\u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u044f<\/h1>\n<p>  <\/p>\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0438 \u0441\u0435\u0439\u0447\u0430\u0441 \u0438\u043d\u043e\u0433\u0434\u0430 \u0437\u043b\u043e\u0443\u043f\u043e\u0442\u0440\u0435\u0431\u043b\u044f\u044e\u0442 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u0440\u0438\u0440\u043e\u0434\u043e\u0439 \u044f\u0437\u044b\u043a\u0430 Python, \u0430 \u0442\u043e\u0433\u0434\u0430, \u0432 90-\u0445, \u043a\u043e\u0433\u0434\u0430 \u043b\u0443\u0447\u0448\u0438\u0435 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0438 \u0435\u0449\u0451 \u043d\u0435 \u0431\u044b\u043b\u0438 \u0448\u0438\u0440\u043e\u043a\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b, \u044d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u043b\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0447\u0430\u0441\u0442\u043e:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">class Address(object):     def __init__(self, host, port):          self.host = host          self.port = port<\/code><\/pre>\n<p>  <\/p>\n<p>\u00ab\u041d\u043e \u044d\u0442\u043e \u0436\u0435 \u043d\u0435\u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e!\u00bb \u2212 \u0433\u043e\u0432\u043e\u0440\u0438\u043b\u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435, \u2212 \u00ab\u0427\u0442\u043e, \u0435\u0441\u043b\u0438 \u043f\u043e\u0440\u0442 \u043d\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f? \u041c\u044b \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0442\u0440\u0430\u0442\u0438\u043c \u043d\u0430 \u0435\u0433\u043e \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0446\u0435\u043b\u044b\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u043a\u043b\u0430\u0441\u0441\u0430!\u00bb \u0418 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u043b\u043e\u0441\u044c \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">class Address(object):     def __init__(self, host, port=None):         self.host = host         if port is not None:  # so terrible             self.port = port<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0430\u043a \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u043e\u0434\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438, \u0442\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u043d\u0435\u043b\u044c\u0437\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0435\u0434\u0438\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u0434\u043d\u0438 \u0438\u0437 \u043d\u0438\u0445 \u0438\u043c\u0435\u044e\u0442 \u043d\u0435\u043a\u0438\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442, \u0430 \u0434\u0440\u0443\u0433\u0438\u0435 \u2212 \u043d\u0435\u0442! \u0418 \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u0438\u043a\u043e\u0441\u043d\u0443\u0442\u044c\u0441\u044f \u043a \u044d\u0442\u043e\u043c\u0443 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0443, \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0432 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0435\u0433\u043e \u043d\u0430\u043b\u0438\u0447\u0438\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\"># code was forced to use introspection # (terrible!) if hasattr(addr, 'port'):     print(addr.port)<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043e\u0431\u0438\u043b\u0438\u0435 <code>hasattr()<\/code>, <code>isinstance()<\/code> \u0438 \u043f\u0440\u043e\u0447\u0435\u0439 \u0438\u043d\u0442\u0440\u043e\u0441\u043f\u0435\u043a\u0446\u0438\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0435\u0440\u043d\u044b\u043c \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u043c \u043f\u043b\u043e\u0445\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u0430 \u043b\u0443\u0447\u0448\u0435\u0439 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u043e\u0439 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0434\u0435\u043b\u0430\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c\u0438 \u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0435. \u042d\u0442\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u043a \u043d\u0435\u043c\u0443:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\"># today\u2019s best practice: # every atribute always present if addr.port is not None:     print(addr.port)<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0430\u043a, \u0440\u0430\u043d\u043d\u0438\u0435 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u044b \u0441 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u043c\u0438 \u0438 \u0443\u0434\u0430\u043b\u044f\u0435\u043c\u044b\u043c\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0438\u0441\u044c, \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c \u043a\u043b\u0430\u0441\u0441\u044b \u0432 Python \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438 \u0432 C++.<\/p>\n<p>  <\/p>\n<p>\u0414\u0440\u0443\u0433\u043e\u0439 \u0434\u0443\u0440\u043d\u043e\u0439 \u043f\u0440\u0438\u0432\u044b\u0447\u043a\u043e\u0439 \u0440\u0430\u043d\u043d\u0435\u0433\u043e Python \u0431\u044b\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0440\u0430\u0437\u043d\u044b\u0435 \u0442\u0438\u043f\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u043b\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0441\u043f\u0438\u0441\u043e\u043a \u0441 \u0438\u043c\u0435\u043d\u0430\u043c\u0438 \u043a\u043e\u043b\u043e\u043d\u043e\u043a, \u0438 \u0441\u0442\u043e\u0301\u0438\u0442 \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c \u0435\u043c\u0443 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0438\u0445 \u0442\u0430\u043a\u0436\u0435 \u0432 \u0432\u0438\u0434\u0435 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u0433\u0434\u0435 \u0438\u043c\u0435\u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u043b\u043e\u043d\u043e\u043a \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u044b, \u0441\u043a\u0430\u0436\u0435\u043c, \u0437\u0430\u043f\u044f\u0442\u043e\u0439:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">class Dataframe(object):     def __init__(self, columns):         if isinstance(columns, str):             columns = columns.split(',')         self.columns = columns<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u043e \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0440\u043e\u0434\u0438\u0442\u044c \u0441\u0432\u043e\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0441\u0442 \u043d\u0430\u043c \u0441\u0442\u0440\u043e\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0435 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0430 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u043a\u0430\u043a \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u043c\u0451\u043d \u043a\u043e\u043b\u043e\u043d\u043e\u043a? \u0418\u043b\u0438 \u0435\u0441\u043b\u0438 \u0438\u043c\u044f \u043a\u043e\u043b\u043e\u043d\u043a\u0438 \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0437\u0430\u043f\u044f\u0442\u0443\u044e?<\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c, \u043e\u0442\u043b\u0430\u0436\u0438\u0432\u0430\u0442\u044c, \u0438 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c: \u0432 \u0442\u0435\u0441\u0442\u0430\u0445 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u0434\u0432\u0443\u0445 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u043d\u0430\u043c\u0438 \u0442\u0438\u043f\u043e\u0432, \u043d\u043e \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u0435 \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442 100%, \u0438 \u043c\u044b \u043d\u0435 \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c \u0434\u0440\u0443\u0433\u043e\u0439 \u0442\u0438\u043f.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u043c\u044b \u043f\u0440\u0438\u0448\u043b\u0438 \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e Python \u0434\u0430\u0451\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043a\u0430\u043a\u043e\u0433\u043e \u0443\u0433\u043e\u0434\u043d\u043e \u0442\u0438\u043f\u0430, \u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0438\u0437 \u043d\u0438\u0445 \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0439 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u043e\u043d\u0438 \u0434\u0435\u043b\u0430\u043b\u0438 \u0431\u044b \u044d\u0442\u043e \u0432 C: \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0435\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043e\u0434\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430.<\/p>\n<p>  <\/p>\n<p>\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f <code>eval()<\/code> \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u044f\u0432\u043d\u044b\u043c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u043c \u043f\u0440\u043e\u0441\u0447\u0451\u0442\u043e\u043c. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0432\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u0441\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u043b\u0438, \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c. \u041d\u043e \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u2212 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u0432\u044b \u043f\u0438\u0448\u0435\u0442\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0442\u0438\u043f\u0430 Jupyter notebook \u0438\u043b\u0438 \u043e\u043d\u043b\u0430\u0439\u043d-\u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0443 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u2212 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 <code>eval()<\/code> \u0432\u043f\u043e\u043b\u043d\u0435 \u043e\u043f\u0440\u0430\u0432\u0434\u0430\u043d\u043e, \u0438 \u0432 \u044d\u0442\u043e\u043c \u0442\u0438\u043f\u0435 \u0437\u0430\u0434\u0430\u0447 Python \u043f\u0440\u043e\u044f\u0432\u043b\u044f\u0435\u0442 \u0441\u0435\u0431\u044f \u0432\u0435\u043b\u0438\u043a\u043e\u043b\u0435\u043f\u043d\u043e! \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0447\u0442\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435 \u043d\u0430 C++ \u0431\u044b\u043b\u043e \u0431\u044b \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435.<\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u043c\u044b \u0443\u0436\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0438 \u0432\u044b\u0448\u0435, \u0438\u043d\u0442\u0440\u043e\u0441\u043f\u0435\u043a\u0446\u0438\u044f (<code>getattr()<\/code>, <code>hasattr()<\/code>, <code>isinstance()<\/code>) \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0445\u043e\u0440\u043e\u0448\u0438\u043c \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0437\u0430\u0434\u0430\u0447. \u041d\u043e \u044d\u0442\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438, \u0442\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u0432 \u044f\u0437\u044b\u043a, \u0438 \u043e\u043d\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0432\u0435\u0440\u043a\u0430\u044e\u0442 \u0432 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u0445, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u0448 \u043a\u043e\u0434 \u0434\u043e\u043b\u0436\u0435\u043d \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0441\u0430\u043c \u0441\u0435\u0431\u044f: \u043b\u043e\u0433\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430, \u043e\u0442\u043b\u0430\u0434\u043a\u0430!<\/p>\n<p>  <\/p>\n<h1>\u042d\u0440\u0430 \u043a\u043e\u043d\u0441\u043e\u043b\u0438\u0434\u0430\u0446\u0438\u0438<\/h1>\n<p>  <\/p>\n<p>\u0412 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043c\u043d\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435: \u043c\u044b \u0436\u0438\u0432\u0451\u043c \u0432 \u0442\u0430\u043a\u043e\u0435 \u0432\u0440\u0435\u043c\u044f, \u043a\u043e\u0433\u0434\u0430 \u043b\u0443\u0447\u0448\u0438\u0435 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043d\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u0430\u0445 \u043f\u0440\u043e\u044f\u0432\u043b\u044f\u044e\u0442 \u0442\u0435\u043d\u0434\u0435\u043d\u0446\u0438\u044e \u043a \u043a\u043e\u043d\u0441\u043e\u043b\u0438\u0434\u0430\u0446\u0438\u0438. 20 \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434 \u044f \u043d\u0435 \u0441\u043c\u043e\u0433 \u0431\u044b \u0434\u0430\u0436\u0435 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044c \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u0442 C++ \u0438 Python. \u0410 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430, \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0432\u0448\u0438\u0435\u0441\u044f \u0432\u043e\u043a\u0440\u0443\u0433 \u0440\u0430\u0437\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u043e\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e \u043e\u0431\u043c\u0435\u043d\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043b\u0443\u0447\u0448\u0438\u043c\u0438 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430\u043c\u0438. \u0418 \u044d\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u0434\u0435\u0432\u044f\u043d\u043e\u0441\u0442\u044b\u0445 \u0438 \u043d\u0443\u043b\u0435\u0432\u044b\u0445.<\/p>\n<p>  <\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0432 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u043c\u043e\u0435\u0439 \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u044b, \u044f \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 <code>shared_ptr<\/code> \u0432 TensorFlow \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0441 2016 \u043f\u043e 2018 \u0433\u043e\u0434.<\/p>\n<p>  <\/p>\n<p>TensorFlow \u2212 \u044d\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0438 \u0432\u043e \u043c\u043d\u043e\u0433\u043e\u043c \u043e\u0431\u0440\u0430\u0437\u0446\u043e\u0432\u044b\u0439 C++-\u043f\u0440\u043e\u0435\u043a\u0442, \u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u0432 \u0437\u043d\u0430\u044e\u0442 \u0435\u0433\u043e \u043b\u0438\u0448\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 Python-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 (\u0430 C++ \u2212 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u0431\u043e\u0440\u043e\u0447\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b TensorFlow, \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435).<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/dm\/1g\/zo\/dm1gzovjtl2qbda7muz5wjzzjhq.png\" alt=\"image\"><\/p>\n<p>  <\/p>\n<p>\u041d\u0430 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0435 \u043f\u043e \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043e \u0441\u043e\u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430 TensorFlow, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0445 <code>shared_ptr<\/code>, \u043a \u043e\u0431\u0449\u0435\u043c\u0443 \u0447\u0438\u0441\u043b\u0443 \u0441\u0442\u0440\u043e\u043a \u043a\u043e\u0434\u0430. \u0412 \u043b\u0443\u0447\u0448\u0438\u0445 \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u044f\u0445 \u041a\u0440\u0435\u043c\u043d\u0438\u0435\u0432\u043e\u0439 \u0434\u043e\u043b\u0438\u043d\u044b, \u044d\u0442\u043e\u0442 \u0433\u0440\u0430\u0444\u0438\u043a \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d \u0441\u0442\u0440\u043e\u0433\u043e \u0432\u0432\u0435\u0440\u0445.<\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a \u043a\u0443\u0434\u0430 \u0436\u0435 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 C++? \u0412 \u043d\u0430\u0447\u0430\u043b\u0435 \u043c\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u043b\u0438 \u043e \u043f\u0440\u0435\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445. \u0427\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0432\u0438\u0434\u0438\u043c? \u0415\u0441\u043b\u0438 \u0432\u0440\u0435\u043c\u044f \u0441\u0442\u0440\u0435\u043c\u0438\u0442\u0441\u044f \u043a \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0441\u0442\u0438, \u0442\u043e \u0432\u0441\u0451 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0440\u0430\u0437\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u043c\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f\u043c\u0438, \u0438 C++ \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f Python!<\/p>\n<\/div>\n<p>               <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/464405\/\"> https:\/\/habr.com\/ru\/post\/464405\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\n<p>\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435. \u041d\u0430\u0447\u0430\u043b\u043e \u0432 \u00ab<a href=\"https:\/\/habr.com\/ru\/post\/464385\/\">Python \u043a\u0430\u043a \u043f\u0440\u0435\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 C++. \u0427\u0430\u0441\u0442\u044c 1\/2<\/a>\u00bb.<\/p>\n<p>  <\/p>\n<h1>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0438 \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445<\/h1>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u0441 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u043e\u0439, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u0432 \u043d\u0430\u0448\u0435\u043c \u044f\u0437\u044b\u043a\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u043e\u0437\u043d\u0430\u0447\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0421++ \u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430 \u0435\u0441\u0442\u044c \u0432\u044b\u0431\u043e\u0440: \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u043c\u044b\u0435 \u0432 \u0441\u0442\u0435\u043a\u0435, \u0438\u043b\u0438 \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u043f\u043e\u043c\u0435\u0449\u0430\u044f \u0432 \u0441\u0442\u0435\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043d\u0430 \u044d\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u0427\u0442\u043e, \u0435\u0441\u043b\u0438 \u043c\u044b \u0432\u044b\u0431\u0435\u0440\u0435\u043c \u0434\u043b\u044f Python \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0443 \u0438\u0437 \u044d\u0442\u0438\u0445 \u043e\u043f\u0446\u0438\u0439?<\/p>\n<p>  <\/p>\n<p>\u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u0442\u0430\u043a \u043a\u0430\u043a \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435 \u043f\u043e\u043c\u0435\u0441\u0442\u044f\u0442\u0441\u044f \u0432 \u0441\u0442\u0435\u043a, \u043b\u0438\u0431\u043e \u0438\u0445 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043f\u043e \u0441\u0442\u0435\u043a\u0443 \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 Python \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438. \u042d\u0442\u043e \u043a\u043e\u043d\u0446\u0435\u043f\u0442\u0443\u0430\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442 \u044f\u0437\u044b\u043a.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-293619","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/293619","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=293619"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/293619\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=293619"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=293619"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=293619"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}