{"id":452839,"date":"2025-03-23T15:07:19","date_gmt":"2025-03-23T15:07:19","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=452839"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=452839","title":{"rendered":"<span>\u041d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0439\u0442\u0435 \u0441\u043b\u043e\u0432\u0430\u0440\u044f\u043c \u043f\u043e\u0440\u0442\u0438\u0442\u044c \u0432\u0430\u0448 \u043a\u043e\u0434<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"><a href=\"https:\/\/habr.com\/ru\/companies\/ruvds\/articles\/890402\/\"><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/cg\/fr\/o6\/cgfro6cujbqt1wvuxvbuaq_ygq0.png\" data-src=\"https:\/\/habrastorage.org\/webt\/cg\/fr\/o6\/cgfro6cujbqt1wvuxvbuaq_ygq0.png\"\/><\/div>\n<p><\/a><br \/> \u041a\u0430\u043a \u0447\u0430\u0441\u0442\u043e \u0432\u0430\u0448\u0438 \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u0438\u0435 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f\u044b \u0438\u043b\u0438 \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u044b\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u044e\u0442\u0441\u044f \u0432 \u043f\u043e\u043b\u043d\u043e\u043c\u0430\u0441\u0448\u0442\u0430\u0431\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f?<\/p>\n<p> \u041f\u0440\u043e\u0441\u0442\u043e\u0442\u0430 \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0440\u0430\u0441\u0442\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u043d\u0435 \u043b\u0438\u0448\u0435\u043d\u0430 \u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u2014 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0442\u0440\u0443\u0434\u043d\u043e \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0442\u044c. \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0440\u0430\u0437\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u043b\u043e\u0432\u0430\u0440\u0435\u0439 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u0447\u0451\u0442\u043a\u043e \u0441\u0438\u0433\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u043e \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0434\u043e\u043b\u0433\u0430. \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0441\u0435\u0433\u043e\u0434\u043d\u044f Python \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0441\u043b\u043e\u0432\u0430\u0440\u0435\u0439 \u043c\u043d\u043e\u0433\u043e \u0430\u0434\u0435\u043a\u0432\u0430\u0442\u043d\u044b\u0445 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432.<a name=\"habracut\"><\/a><\/p>\n<h2><font color=\"#3AC1EF\">\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435<\/font><\/h2>\n<p> <\/p>\n<ol>\n<li><a href=\"#1\">\u0427\u0442\u043e \u043d\u0435 \u0442\u0430\u043a \u0441\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u044f\u043c\u0438?<\/a><br \/> \n<ol>\n<li><a href=\"#2\">\u0421\u043b\u043e\u0432\u0430\u0440\u0438 \u043d\u0435\u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u044b.<\/a><\/li>\n<li><a href=\"#3\">\u0421\u043b\u043e\u0432\u0430\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b.<\/a><\/li>\n<\/ol>\n<\/li>\n<li><a href=\"#4\">\u0420\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0439\u0442\u0435 \u0441\u043b\u043e\u0432\u0430\u0440\u0438 \u043a\u0430\u043a \u0444\u043e\u0440\u043c\u0430\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445.<\/a><\/li>\n<li><a href=\"#5\">\u0423\u043f\u0440\u043e\u0449\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439.<\/a><br \/> \n<ol>\n<li><a href=\"#6\">\u0421\u043e\u0437\u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e<\/a> <code>dataclasses<\/code>. <\/li>\n<li><a href=\"#7\">\u041b\u0438\u0431\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Pydantic.<\/a><\/li>\n<\/ol>\n<\/li>\n<li><a href=\"#8\">\u0412 \u043b\u0435\u0433\u0430\u0441\u0438-\u043a\u043e\u0434\u0435 \u0430\u043d\u043d\u043e\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0441\u043b\u043e\u0432\u0430\u0440\u0438 \u043a\u0430\u043a <\/a> <code>TypedDict<\/code>.<\/li>\n<li><a href=\"#9\">\u0412 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430\u0445 \u043f\u0430\u0440 \u043a\u043b\u044e\u0447-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0430\u043d\u043d\u043e\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0441\u043b\u043e\u0432\u0430\u0440\u0438 \u043a\u0430\u043a \u043c\u044d\u043f\u043f\u0438\u043d\u0433\u0438.<\/a><\/li>\n<li><a href=\"#10\">\u0412\u043e\u0437\u044c\u043c\u0438\u0442\u0435 \u0441\u043b\u043e\u0432\u0430\u0440\u0438 \u043f\u043e\u0434 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c.<\/a> <\/li>\n<\/ol>\n<p> <a name=\"1\"><\/a><\/p>\n<h2><font color=\"#3AC1EF\">\u0427\u0442\u043e \u043d\u0435 \u0442\u0430\u043a \u0441\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u044f\u043c\u0438?<\/font><\/h2>\n<p> <a name=\"2\"><\/a><\/p>\n<h3><font color=\"#3AC1EF\">\u258d \u0421\u043b\u043e\u0432\u0430\u0440\u0438 \u043d\u0435\u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u044b<\/font><\/h3>\n<p> \u0424\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442 \u0441\u043b\u043e\u0432\u0430\u0440\u0438, \u043e\u0447\u0435\u043d\u044c \u0442\u0440\u0443\u0434\u043d\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0442\u044c \u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c. \u041a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0434\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0449\u0435\u0439 \u0441\u043b\u043e\u0432\u0430\u0440\u044c, \u043d\u0443\u0436\u043d\u043e \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043e\u0442\u0441\u043b\u0435\u0434\u0438\u0442\u044c \u0435\u0451 \u0432\u044b\u0437\u043e\u0432\u044b \u0432\u043f\u043b\u043e\u0442\u044c \u0434\u043e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432, \u0433\u0434\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u0441\u044f \u0441\u043b\u043e\u0432\u0430\u0440\u044c. \u0417\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435 \u043e\u0434\u0438\u043d \u043f\u0443\u0442\u044c \u0432\u044b\u0437\u043e\u0432\u0430, \u0438 \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0440\u0430\u0437\u0440\u0430\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0431\u0435\u0437 \u0447\u0451\u0442\u043a\u043e\u0433\u043e \u043f\u043b\u0430\u043d\u0430, \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u0445 \u0441\u043b\u043e\u0432\u0430\u0440\u0435\u0439 \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442 \u0440\u0430\u0441\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f.<\/p>\n<p> <a name=\"3\"><\/a><\/p>\n<h3><font color=\"#3AC1EF\">\u258d \u0421\u043b\u043e\u0432\u0430\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c\u044b<\/font><\/h3>\n<p> \u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0441\u043b\u043e\u0432\u0430\u0440\u0435\u0439 \u0434\u043b\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c\u0443 \u0440\u0430\u0431\u043e\u0447\u0435\u043c\u0443 \u043f\u043e\u0442\u043e\u043a\u0443 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u0435\u0441\u044c\u043c\u0430 \u0437\u0430\u043c\u0430\u043d\u0447\u0438\u0432\u044b\u043c. \u0418 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u044b \u043d\u0435\u0440\u0435\u0434\u043a\u043e \u044d\u0442\u0438\u043c \u0433\u0440\u0435\u0448\u0430\u0442. \u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u043c\u0435\u0441\u0442\u0430\u0445 \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u043f\u043e\u0434 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0438\u043c\u0435\u043d\u0430\u043c\u0438: \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430, \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435, \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435, \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u041d\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0431\u0443\u0434\u0435\u0442 \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435. \u041f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043d\u0430\u0440\u0443\u0448\u0430\u044e\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0434\u0435\u043b\u0430\u044e\u0442 \u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u043c\u0438 \u043e\u0442 \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. <\/p>\n<p> \u041f\u0440\u0438\u0447\u0451\u043c \u0441\u043b\u043e\u0432\u0430\u0440\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0432\u043e\u0438 \u0434\u0430\u043d\u043d\u044b\u0435, \u043d\u043e \u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0438\u043b\u0438 \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u043f\u043e\u043b\u044f, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0438\u0445 \u0442\u0438\u043f\u044b. \u0412\u043e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0441\u0451 \u044d\u0442\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0445\u0443\u0434\u0448\u0438\u043c, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438.<\/p>\n<p> <a name=\"4\"><\/a><\/p>\n<h2><font color=\"#3AC1EF\">\u0420\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0439\u0442\u0435 \u0441\u043b\u043e\u0432\u0430\u0440\u0438 \u043a\u0430\u043a \u0444\u043e\u0440\u043c\u0430\u0442 \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445<\/font><\/h2>\n<p> \u041a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0441\u043b\u043e\u0432\u0430\u0440\u0438 \u0432 \u043a\u043e\u0434\u0435 \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u043f\u0443\u0442\u0451\u043c \u0434\u0435\u0441\u0435\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 JSON, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u0438\u0437 \u043e\u0442\u0432\u0435\u0442\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0433\u043e API.<\/p>\n<p> \u0421\u043b\u043e\u0432\u0430\u0440\u044c, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0451\u043d\u043d\u044b\u0439 \u0438\u0437 API:<\/p>\n<pre><code class=\"python\">&gt;&gt;&gt; requests.get(\"https:\/\/api.github.com\/repos\/imankulov\/empty\").json() {'id': 297081773,  'node_id': 'MDEwOlJlcG9zaXRvcnkyOTcwODE3NzM=',  'name': 'empty',  'full_name': 'imankulov\/empty',  'private': False, ... }<\/code><\/pre>\n<p> \u0412\u044b\u0440\u0430\u0431\u043e\u0442\u0430\u0439\u0442\u0435 \u043f\u0440\u0438\u0432\u044b\u0447\u043a\u0443 \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0441\u043b\u043e\u0432\u0430\u0440\u0438 \u043a\u0430\u043a \u0444\u043e\u0440\u043c\u0430\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0438 \u0441\u0440\u0430\u0437\u0443 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u044b\u0432\u0430\u0439\u0442\u0435 \u0438\u0445 \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u0435 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u044f\u0441\u043d\u043e\u0441\u0442\u044c. <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/ip\/1w\/5f\/ip1w5fagopw8etuaad_mssgeiqo.png\" data-src=\"https:\/\/habrastorage.org\/webt\/ip\/1w\/5f\/ip1w5fagopw8etuaad_mssgeiqo.png\"\/><\/div>\n<p><i><font color=\"#999999\">\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e\/\u0434\u0435\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u0435\u0436\u0434\u0443 \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u043c \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0438 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c<\/font><\/i><\/p>\n<p> \u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u043b\u0435\u0433\u043a\u043e.<\/p>\n<ul>\n<li>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438. \u0412 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043e\u043d\u0438 \u0432\u044b\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u043a\u043b\u0430\u0441\u0441\u043e\u043c.<\/li>\n<li>\u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0439\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0438 \u0434\u0435\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0432 \u043e\u0434\u043d\u043e\u043c \u0448\u0430\u0433\u0435.<\/li>\n<\/ul>\n<p> \u0412 \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u0434\u0438\u0437\u0430\u0439\u043d\u0435 (Domain-Driven Design, DDD) \u044d\u0442\u043e\u0442 \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d \u043a\u0430\u043a \u043f\u0440\u0435\u0434\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c (anti-corruption layer). \u041f\u043e\u043c\u0438\u043c\u043e \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u044f\u0441\u043d\u043e\u0441\u0442\u0438, \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c, \u043e\u0442\u0434\u0435\u043b\u044f\u044e\u0449\u0438\u0439 \u0432\u043d\u0435\u0448\u043d\u044e\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u043e\u0442 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. <\/p>\n<p> \u041d\u0438\u0436\u0435 \u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u0434\u0432\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u044e\u0449\u0435\u0439 \u0441 GitHub \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438:<\/p>\n<p> \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u0441\u043b\u043e\u0432\u0430\u0440\u044f:<\/p>\n<pre><code class=\"python\">import requests  def get_repo(repo_name: str):     \"\"\"Return repository info by its name.\"\"\"     return requests.get(f\"https:\/\/api.github.com\/repos\/{repo_name}\").json()<\/code><\/pre>\n<p> \u0412\u044b\u0432\u043e\u0434 \u0442\u0430\u043a\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u044b\u043c \u0438 \u0438\u0437\u043b\u0438\u0448\u043d\u0435 \u0433\u0440\u043e\u043c\u043e\u0437\u0434\u043a\u0438\u043c, \u0442\u0430\u043a \u043a\u0430\u043a \u0435\u0433\u043e \u0444\u043e\u0440\u043c\u0430\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u043d\u0435 \u0432\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<pre><code class=\"plaintext\">&gt;&gt;&gt; get_repo(\"imankulov\/empty\") {'id': 297081773,  'node_id': 'MDEwOlJlcG9zaXRvcnkyOTcwODE3NzM=',  'name': 'empty',  'full_name': 'imankulov\/empty',  'private': False,  # \u041c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u0445 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432, URL \u0438 \u043f\u0440\u043e\u0447\u0435\u0433\u043e.  # ... }<\/code><\/pre>\n<p> \u041c\u043e\u0434\u0435\u043b\u044c \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438:<\/p>\n<pre><code class=\"python\">class GitHubRepo:     \"\"\"GitHub repository.\"\"\"     def __init__(self, owner: str, name: str, description: str):         self.owner = owner         self.name = name         self.description = description      def full_name(self) -&gt; str:         \"\"\"Get the repository full name.\"\"\"         return f\"{self.owner}\/{self.name}\"  def get_repo(repo_name: str) -&gt; GitHubRepo:     \"\"\"Return repository info by its name.\"\"\"     data = requests.get(f\"https:\/\/api.github.com\/repos\/{repo_name}\").json()     return GitHubRepo(data[\"owner\"][\"login\"], data[\"name\"], data[\"description\"]) &gt;&gt;&gt; get_repo(\"imankulov\/empty\") &lt;GitHubRepo at 0x103023520&gt;<\/code><\/pre>\n<p> \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u043a\u043e\u0434\u0430, \u0442\u0430\u043a\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043b\u0443\u0447\u0448\u0435 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e, \u0435\u0441\u043b\u0438 \u0440\u0435\u0447\u044c \u0438\u0434\u0451\u0442 \u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0435 \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0438 \u043a\u043e\u0434\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u044b.<\/p>\n<p> \u0412 \u0447\u0451\u043c \u0436\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u044f.<\/p>\n<ul>\n<li>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0442\u0447\u0451\u0442\u043b\u0438\u0432\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0430, \u0438 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u0435\u0442\u0430\u043b\u0438.<\/li>\n<li>\u0412 \u043a\u043b\u0430\u0441\u0441\u0435 \u0442\u0430\u043a\u0436\u0435 \u0435\u0441\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <code>full_name()<\/code>, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0438\u0439 \u0435\u0433\u043e \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0443. \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0441\u043b\u043e\u0432\u0430\u0440\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0442\u044c \u043a\u043e\u0434 \u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0440\u044f\u0434\u043e\u043c.<\/li>\n<li>\u0417\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u043e\u0442 GitHub API \u0438\u0437\u043e\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>get_repo()<\/code>. \u041e\u0431\u044a\u0435\u043a\u0442\u0443 <code>GitHubRepo<\/code> \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u0437\u043d\u0430\u0442\u044c \u043e \u0432\u043d\u0435\u0448\u043d\u0435\u043c API \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0434\u0435\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432: \u0438\u0437 \u0444\u0438\u043a\u0441\u0442\u0443\u0440 pytest, GraphQL API, \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u044d\u0448\u0430 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435.<\/li>\n<\/ul>\n<p> <\/p>\n<blockquote><p>\u261d\ufe0f \u0418\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0439\u0442\u0435 \u043f\u043e\u043b\u044f, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u043e\u0442 API, \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u044b, \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435.<\/p><\/blockquote>\n<p> \u0412\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0432\u0430\u043c \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043f\u043e\u043b\u0435\u0439, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u044b\u0445 \u043e\u0442 API, \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u0414\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u043b\u0435\u0439 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0443\u0441\u0442\u043e\u0439 \u0442\u0440\u0430\u0442\u043e\u0439 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043d\u043e \u0438 \u043b\u0438\u0448\u0430\u0435\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u0438, \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u044f \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u0443 \u0438\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0432 \u043d\u043e\u0432\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 API. \u0421 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0447\u0435\u043c \u043c\u0435\u043d\u044c\u0448\u0435 \u043f\u043e\u043b\u0435\u0439, \u0442\u0435\u043c \u043c\u0435\u043d\u044c\u0448\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432.<\/p>\n<p> <a name=\"5\"><\/a><\/p>\n<h2><font color=\"#3AC1EF\">\u0423\u043f\u0440\u043e\u0449\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438<\/font><\/h2>\n<p> \u0414\u043b\u044f \u043e\u0431\u0451\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0441\u043b\u043e\u0432\u0430\u0440\u0435\u0439 \u043d\u0443\u0436\u043d\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043a\u043b\u0430\u0441\u0441\u043e\u0432. \u0412 \u044d\u0442\u043e\u043c \u043f\u043b\u0430\u043d\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0441\u0435\u0431\u0435 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0432\u0430\u0441 \u00ab\u0431\u043e\u043b\u0435\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b\u00bb.<\/p>\n<p> <a name=\"6\"><\/a><\/p>\n<h3><font color=\"#3AC1EF\">\u258d \u0421\u043e\u0437\u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e dataclasses<\/font><\/h3>\n<p> \u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 v 3.7, \u0432 Python \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c <a href=\"https:\/\/docs.python.org\/3\/library\/dataclasses.html\">Data Classes<\/a>. \u041c\u043e\u0434\u0443\u043b\u044c <code>dataclasses<\/code> \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440 \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432 \u043a\u043b\u0430\u0441\u0441\u044b \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0432\u0440\u043e\u0434\u0435 <code>__init__()<\/code> \u0438 <code>__repr__()<\/code>. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043c\u0435\u043d\u044c\u0448\u0435.<\/p>\n<p> \u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u043a\u043b\u0430\u0441\u0441\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0438\u043b\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432, \u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0445\u043e\u0447\u0443 \u0432\u043d\u043e\u0441\u0438\u0442\u044c \u043b\u0438\u0448\u043d\u0438\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438. \u0412\u043e\u0442 \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043c\u043e\u0434\u0435\u043b\u044c <code>GitHubRepo<\/code> \u0441 \u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<pre><code class=\"python\">from dataclasses import dataclass  @dataclass(frozen=True) class GitHubRepo:     \"\"\"GitHub repository.\"\"\"     owner: str     name: str     description: str      def full_name(self) -&gt; str:         \"\"\"Get the repository full name.\"\"\"         return f\"{self.owner}\/{self.name}\"<\/code><\/pre>\n<p> \u041a\u043e\u0433\u0434\u0430 \u044f \u0441\u043e\u0437\u0434\u0430\u044e \u043a\u043b\u0430\u0441\u0441\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u043e\u043d\u0438 \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u043a\u0430\u043a \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 (<code>frozen<\/code>). \u0412\u043c\u0435\u0441\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u044f \u0441\u043e\u0437\u0434\u0430\u044e \u043d\u043e\u0432\u044b\u0439 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <code>dataclasses.replace()<\/code>. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f, \u0432\u044b \u043e\u0431\u043b\u0435\u0433\u0447\u0430\u0435\u0442\u0435 \u0436\u0438\u0437\u043d\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0447\u0438\u0442\u0430\u0442\u044c \u0438\u043b\u0438 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0442\u044c \u0432\u0430\u0448 \u043a\u043e\u0434.<\/p>\n<p> <a name=\"7\"><\/a><\/p>\n<h3><font color=\"#3AC1EF\">\u258d \u0410\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430 \u2014 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Pydantic<\/font><\/h3>\n<p> \u041d\u0435\u0434\u0430\u0432\u043d\u043e \u044f \u043d\u0430\u0447\u0430\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <a href=\"https:\/\/pydantic-docs.helpmanual.io\/\">Pydantic<\/a>, \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0443\u044e \u0437\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u0415\u0441\u043b\u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0435\u0451 \u0441 \u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u0442\u043e \u043e\u043d\u0430 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u0435\u0439. \u041c\u043d\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043d\u0440\u0430\u0432\u044f\u0442\u0441\u044f \u0435\u0451 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u044b \u0438 \u0434\u0435\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u044b, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 \u0438 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0435 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u044b.<\/p>\n<p> \u0421\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u044b \u0443\u043f\u0440\u043e\u0449\u0430\u044e\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0432\u043e \u0432\u043d\u0435\u0448\u043d\u0435\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 JSON \u0432 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044e \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. \u0412\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u044b \u0436\u0435 \u043f\u0440\u0438\u0433\u043e\u0436\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447\u0430\u0445.<\/p>\n<p> \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 Pydantic \u0442\u0430 \u0436\u0435 \u043c\u043e\u0434\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"python\">from pydantic import BaseModel   class GitHubRepo(BaseModel):     \"\"\"GitHub repository.\"\"\"     owner: str     name: str     description: str      class Config:         frozen = True      def full_name(self) -&gt; str:         \"\"\"Get the repository full name.\"\"\"         return f\"{self.owner}\/{self.name}\"<\/code><\/pre>\n<p> \u041e\u043d\u043b\u0430\u0439\u043d-\u0441\u0435\u0440\u0432\u0438\u0441 <a href=\"https:\/\/jsontopydantic.com\/\">jsontopydantic.com<\/a> \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442 \u043c\u043e\u0451 \u0432\u0440\u0435\u043c\u044f, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u0438 Pydantic \u0438\u0437 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u044b\u0445 \u043e\u0442 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445 API. \u042f \u043a\u043e\u043f\u0438\u0440\u0443\u044e \u0432 \u044d\u0442\u043e\u0442 \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u0438 \u043e\u043d \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043c\u043e\u0434\u0435\u043b\u0438 Pydantic.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/1b\/k0\/ky\/1bk0kyyxdgc2hph8e5wdrxlaymo.png\" data-src=\"https:\/\/habrastorage.org\/webt\/1b\/k0\/ky\/1bk0kyyxdgc2hph8e5wdrxlaymo.png\"\/><\/div>\n<p><i><font color=\"#999999\">jsontopydantic.com \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u043e\u0442\u0432\u0435\u0442 Todoist API \u0432 \u043c\u043e\u0434\u0435\u043b\u044c Pydantic<\/font><\/i><\/p>\n<p> \u041f\u0440\u0438\u043c\u0435\u0440\u044b \u043c\u043e\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Pydantic \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u00ab<a href=\"https:\/\/roman.pt\/posts\/time-series-caching\/\">Time Series Caching with Python and Redis<\/a>\u00bb.<\/p>\n<p> <a name=\"8\"><\/a><\/p>\n<h3><font color=\"#3AC1EF\">\u258d \u0412 \u043b\u0435\u0433\u0430\u0441\u0438-\u043a\u043e\u0434\u0435 \u0430\u043d\u043d\u043e\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0441\u043b\u043e\u0432\u0430\u0440\u0438 \u043a\u0430\u043a <code>TypedDict<\/code><\/font><\/h3>\n<p> \u0412 Python 3.8 \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 <a href=\"https:\/\/www.python.org\/dev\/peps\/pep-0589\/\">TypedDicts<\/a>. \u0412 \u0441\u0440\u0435\u0434\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u043d\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0442 \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u0441\u043b\u043e\u0432\u0430\u0440\u0438, \u043d\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0441\u0432\u043e\u0435\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432, \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u043e\u0432 \u0442\u0438\u043f\u043e\u0432 \u0438 IDE.<\/p>\n<p> \u0415\u0441\u043b\u0438 \u0432\u044b \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u0435 \u043d\u0430\u0441\u044b\u0449\u0435\u043d\u043d\u044b\u0439 \u0441\u043b\u043e\u0432\u0430\u0440\u044f\u043c\u0438 \u043b\u0435\u0433\u0430\u0441\u0438-\u043a\u043e\u0434 \u0438 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u043a\u0430\u043a \u0435\u0433\u043e \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e \u043e\u0442\u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0442\u044c, \u0442\u043e \u0445\u043e\u0442\u044f \u0431\u044b \u0430\u043d\u043d\u043e\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0432\u0441\u0435 \u0441\u043b\u043e\u0432\u0430\u0440\u0438 \u043a\u0430\u043a \u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435.<\/p>\n<pre><code class=\"python\">from typing import TypedDict   class GitHubRepo(TypedDict):     \"\"\"GitHub repository.\"\"\"     owner: str     name: str     description: str  repo: GitHubRepo = {     \"owner\": \"imankulov\",     \"name\": \"empty\",     \"description\": \"An empty repository\", }<\/code><\/pre>\n<p> \u041d\u0438\u0436\u0435 \u044f \u043f\u0440\u0438\u0432\u0451\u043b \u0434\u0432\u0430 \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u0430 \u0438\u0437 PyCharm, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0442\u0438\u043f\u0430 \u043c\u043e\u0436\u0435\u0442 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0432 IDE \u0438 \u0437\u0430\u0449\u0438\u0442\u0438\u0442\u044c \u043e\u0442 \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/rp\/or\/jo\/rporjoq8ufaiewsh0xv8o3vqbkk.png\" data-src=\"https:\/\/habrastorage.org\/webt\/rp\/or\/jo\/rporjoq8ufaiewsh0xv8o3vqbkk.png\"\/><\/div>\n<p><i><font color=\"#999999\">PyCharm \u0437\u043d\u0430\u0435\u0442 \u0442\u0438\u043f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0430\u0432\u0442\u043e\u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f<\/font><\/i><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/qw\/rj\/l9\/qwrjl9erf88mxkd-d38mh4hbnem.png\" data-src=\"https:\/\/habrastorage.org\/webt\/qw\/rj\/l9\/qwrjl9erf88mxkd-d38mh4hbnem.png\"\/><\/div>\n<p><i><font color=\"#999999\">PyCharm \u0437\u043d\u0430\u0435\u0442 \u043e \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u044e\u0449\u0435\u043c \u043a\u043b\u044e\u0447\u0435 \u0438 \u0432\u044b\u0434\u0430\u0451\u0442 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435<\/font><\/i><\/p>\n<p> <a name=\"9\"><\/a><\/p>\n<h3><font color=\"#3AC1EF\">\u258d \u0412 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430\u0445 \u043f\u0430\u0440 \u043a\u043b\u044e\u0447-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0430\u043d\u043d\u043e\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0441\u043b\u043e\u0432\u0430\u0440\u0438 \u043a\u0430\u043a \u043c\u044d\u043f\u043f\u0438\u043d\u0433\u0438<\/font><\/h3>\n<p> \u041e\u043f\u0440\u0430\u0432\u0434\u0430\u043d\u043d\u044b\u043c \u0441\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u043b\u043e\u0432\u0430\u0440\u0435\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u043f\u0430\u0440 \u043a\u043b\u044e\u0447-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0433\u0434\u0435 \u0432\u0441\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u043c\u0435\u044e\u0442 \u043e\u0434\u0438\u043d \u0442\u0438\u043f, \u0430 \u043a\u043b\u044e\u0447\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0438\u0445 \u043f\u043e\u0438\u0441\u043a\u0430.<\/p>\n<p> \u0421\u043b\u043e\u0432\u0430\u0440\u044c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u043a\u0430\u043a \u043c\u044d\u043f\u043f\u0438\u043d\u0433: <\/p>\n<pre><code class=\"python\">colors = {     \"red\": \"#FF0000\",     \"pink\": \"#FFC0CB\",     \"purple\": \"#800080\", }<\/code><\/pre>\n<p> \u041f\u0440\u0438 \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435 \u0442\u0430\u043a\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u044f \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u043e\u0434\u0443\u043c\u0430\u0439\u0442\u0435 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0441\u043a\u0440\u044b\u0442\u044c \u0434\u0435\u0442\u0430\u043b\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0430\u043d\u043d\u043e\u0442\u0438\u0440\u043e\u0432\u0430\u0432 \u0442\u0438\u043f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043a\u0430\u043a <code>Mapping<\/code> \u0438\u043b\u0438 <code>MutableMapping<\/code>. \u0421 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043f\u0435\u0440\u0435\u0431\u043e\u0440\u043e\u043c, \u0432\u0435\u0434\u044c \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u043e\u0439 \u0438 \u043f\u043e\u043a\u0430 \u0447\u0442\u043e \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0442\u0438\u043f\u0438\u0447\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 <code>MutableMapping<\/code>. \u0421 \u0434\u0440\u0443\u0433\u043e\u0439 \u0436\u0435 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u0430\u043d\u043d\u043e\u0442\u0438\u0440\u0443\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043a\u0430\u043a \u043c\u044d\u043f\u043f\u0438\u043d\u0433, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0442\u0438\u043f\u044b \u0434\u043b\u044f \u043a\u043b\u044e\u0447\u0435\u0439 \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0442\u0438\u043f\u0430 <code>Mapping<\/code> \u0432\u044b \u044f\u0441\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0435, \u0447\u0442\u043e \u043e\u0431\u044a\u0435\u043a\u0442 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f.<\/p>\n<p> \u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440, \u0433\u0434\u0435 \u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b \u043c\u044d\u043f\u043f\u0438\u043d\u0433 \u0446\u0432\u0435\u0442\u043e\u0432 \u0438 \u0430\u043d\u043d\u043e\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u0444\u0443\u043d\u043a\u0446\u0438\u044e. \u0417\u0430\u043c\u0435\u0442\u044c\u0442\u0435, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e, \u0440\u0430\u0437\u0440\u0435\u0448\u0451\u043d\u043d\u0443\u044e \u0434\u043b\u044f \u0441\u043b\u043e\u0432\u0430\u0440\u0435\u0439, \u043d\u043e \u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u0443\u044e \u0434\u043b\u044f \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 <code>Mapping<\/code>:<\/p>\n<pre><code class=\"python\"># \u0444\u0430\u0439\u043b: colors.py from typing import Mapping  colors: Mapping[str, str] = {     \"red\": \"#FF0000\",     \"pink\": \"#FFC0CB\",     \"purple\": \"#800080\", }  def add_yellow(colors: Mapping[str, str]):     colors[\"yellow\"] = \"#FFFF00\"  if __name__ == \"__main__\":     add_yellow(colors)     print(colors)<\/code><\/pre>\n<p> \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0435 \u0442\u0438\u043f\u044b, \u0432 \u0441\u0440\u0435\u0434\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043d\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f.<\/p>\n<pre><code class=\"python\">$ python colors.py {'red': '#FF0000', 'pink': '#FFC0CB', 'purple': '#800080', 'yellow': '#FFFF00'} <\/code><\/pre>\n<p> \u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0441\u0442\u0438 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e mypy, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u044b\u0434\u0430\u0451\u0442 \u043e\u0448\u0438\u0431\u043a\u0443.<\/p>\n<pre><code class=\"python\">$ mypy colors.py colors.py:11: error: Unsupported target for indexed assignment (\"Mapping[str, str]\") Found 1 error in 1 file (checked 1 source file)<\/code><\/pre>\n<p> <a name=\"10\"><\/a><\/p>\n<h2><font color=\"#3AC1EF\">\u0414\u0435\u0440\u0436\u0438\u0442\u0435 \u0441\u043b\u043e\u0432\u0430\u0440\u0438 \u043f\u043e\u0434 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0435\u043c<\/font><\/h2>\n<p> \u0421\u043b\u0435\u0434\u0438\u0442\u0435 \u0437\u0430 \u0441\u043b\u043e\u0432\u0430\u0440\u044f\u043c\u0438. \u041d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0439\u0442\u0435 \u0438\u043c \u0437\u0430\u0445\u0432\u0430\u0442\u0438\u0442\u044c \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041a\u0430\u043a \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043b\u044e\u0431\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0434\u043e\u043b\u0433\u0430, \u0447\u0435\u043c \u0434\u043e\u043b\u044c\u0448\u0435 \u0432\u044b \u043e\u0442\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442\u0435 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0434\u0430\u043d\u043d\u044b\u0445, \u0442\u0435\u043c \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u043d\u0430 \u043d\u0438\u0445 \u0432 \u0438\u0442\u043e\u0433\u0435 \u043f\u0435\u0440\u0435\u0439\u0442\u0438.<\/p>\n<blockquote><p><b><font color=\"#3AC1EF\"><a href=\"https:\/\/t.me\/ruvds_community\">Telegram-\u043a\u0430\u043d\u0430\u043b \u0441\u043e \u0441\u043a\u0438\u0434\u043a\u0430\u043c\u0438, \u0440\u043e\u0437\u044b\u0433\u0440\u044b\u0448\u0430\u043c\u0438 \u043f\u0440\u0438\u0437\u043e\u0432 \u0438 \u043d\u043e\u0432\u043e\u0441\u0442\u044f\u043c\u0438 IT \ud83d\udcbb<\/a><\/font><\/b><\/p><\/blockquote>\n<p><a href=\"https:\/\/ruvds.com\/ru-rub?utm_source=habr&amp;utm_medium=article&amp;utm_campaign=Bright_Translate&amp;utm_content=ne_pozvolyajte_slovaryam_portit_vash_kod\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/yo\/se\/km\/yosekm4h_f7y7oia-ghbbpc0phi.png\" data-src=\"https:\/\/habrastorage.org\/webt\/yo\/se\/km\/yosekm4h_f7y7oia-ghbbpc0phi.png\"\/><\/a><\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><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\/articles\/890402\/\"> https:\/\/habr.com\/ru\/articles\/890402\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"><a href=\"https:\/\/habr.com\/ru\/companies\/ruvds\/articles\/890402\/\"><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/cg\/fr\/o6\/cgfro6cujbqt1wvuxvbuaq_ygq0.png\" data-src=\"https:\/\/habrastorage.org\/webt\/cg\/fr\/o6\/cgfro6cujbqt1wvuxvbuaq_ygq0.png\"\/><\/div>\n<p><\/a><br \/> \u041a\u0430\u043a \u0447\u0430\u0441\u0442\u043e \u0432\u0430\u0448\u0438 \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u0438\u0435 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f\u044b \u0438\u043b\u0438 \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043d\u044b\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u044e\u0442\u0441\u044f \u0432 \u043f\u043e\u043b\u043d\u043e\u043c\u0430\u0441\u0448\u0442\u0430\u0431\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f?<\/p>\n<p> \u041f\u0440\u043e\u0441\u0442\u043e\u0442\u0430 \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0440\u0430\u0441\u0442\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u043d\u0435 \u043b\u0438\u0448\u0435\u043d\u0430 \u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u2014 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0442\u0440\u0443\u0434\u043d\u043e \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0442\u044c. \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0440\u0430\u0437\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u043b\u043e\u0432\u0430\u0440\u0435\u0439 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u0447\u0451\u0442\u043a\u043e \u0441\u0438\u0433\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u043e \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0434\u043e\u043b\u0433\u0430. \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0441\u0435\u0433\u043e\u0434\u043d\u044f Python \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0441\u043b\u043e\u0432\u0430\u0440\u0435\u0439 \u043c\u043d\u043e\u0433\u043e \u0430\u0434\u0435\u043a\u0432\u0430\u0442\u043d\u044b\u0445 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432.<\/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-452839","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/452839","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=452839"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/452839\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=452839"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=452839"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=452839"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}