{"id":333010,"date":"2022-05-11T15:00:58","date_gmt":"2022-05-11T15:00:58","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=333010"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=333010","title":{"rendered":"<span>\u041a\u0430\u043a \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0430\u0441\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 Python \u0437\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0433\u043e\u0434\u044b<\/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\">\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/zg\/ho\/xo\/zghoxoqg9oytk6lkfbkb68n8qf0.png\" alt=\"Python 3.8+\" data-src=\"https:\/\/habrastorage.org\/webt\/zg\/ho\/xo\/zghoxoqg9oytk6lkfbkb68n8qf0.png\"\/><\/p>\n<p>  <\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f Python, \u0432\u0441\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0434\u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u043c \u0444\u0438\u0447\u0430\u043c \u044f\u0437\u044b\u043a\u0430: \u043c\u043e\u0440\u0436\u043e\u0432\u043e\u043c\u0443 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0443, \u0441\u043b\u0438\u044f\u043d\u0438\u044e \u0441\u043b\u043e\u0432\u0430\u0440\u0435\u0439, \u043f\u0430\u0442\u0442\u0435\u0440\u043d-\u043c\u0430\u0442\u0447\u0438\u043d\u0433\u0443. \u0415\u0449\u0435 \u043c\u043d\u043e\u0433\u043e \u043f\u0438\u0448\u0443\u0442 \u043e\u0431 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u0445 \u0432 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0435 (\u043c\u043e\u0434\u0443\u043b\u044c <code>asyncio<\/code>) \u0438 \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u0438 (\u043c\u043e\u0434\u0443\u043b\u044c <code>typing<\/code>) \u2014 \u044d\u0442\u0438 \u043c\u043e\u0434\u0443\u043b\u0438 \u043d\u0430 \u0432\u0438\u0434\u0443 \u0438 \u0431\u0443\u0440\u043d\u043e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u044e\u0442\u0441\u044f.<\/p>\n<p>  <\/p>\n<p>\u041e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c \u043c\u043e\u0434\u0443\u043b\u044f\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0434\u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043d\u0435\u0437\u0430\u0441\u043b\u0443\u0436\u0435\u043d\u043d\u043e \u043c\u0430\u043b\u043e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f. \u0425\u043e\u0447\u0443 \u044d\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0433\u043e \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u0432 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 3.8\u20133.10.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<blockquote><p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u044d\u0442\u043e \u043d\u0435 \u0438\u0441\u0447\u0435\u0440\u043f\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0441\u043f\u0438\u0441\u043e\u043a. \u041f\u0438\u0448\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u043e \u0442\u0435\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043b\u0438 \u043b\u0438\u0447\u043d\u043e \u043c\u0435\u043d\u044f. \u041d\u043e \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044f \u043d\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0441\u044c \u043e\u0442 \u00ab\u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e\u00bb \u0431\u044d\u043a\u0435\u043d\u0434-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u043d\u0430 \u043f\u0438\u0442\u043e\u043d\u0435 \u2014 \u0432\u043f\u043e\u043b\u043d\u0435 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u0432\u0430\u0441 \u043e\u043d\u0438 \u0442\u043e\u0436\u0435 \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0442. \u0415\u0441\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u043b \u2014 \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u0439\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/p><\/blockquote>\n<p>\u041c\u043e\u0434\u0443\u043b\u0438 \u0438\u0434\u0443\u0442 \u0432 \u0430\u043b\u0444\u0430\u0432\u0438\u0442\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435, \u0442\u0430\u043a \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0437\u0430\u0441\u043a\u0443\u0447\u0430\u0435\u0442\u0435 \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0445 (\u043c\u0430\u043b\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445) \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u0435\u043b\u044f\u0445, \u043d\u0435 \u0443\u043d\u044b\u0432\u0430\u0439\u0442\u0435 \u2014\u00a0\u0434\u0430\u043b\u044c\u0448\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0435.<\/p>\n<p>  <\/p>\n<p><a href=\"#array\">array<\/a> \u2022 <a href=\"#base64\">base64<\/a> \u2022 <a href=\"#bisect\">bisect<\/a> \u2022 <a href=\"#builtins\">builtins<\/a> \u2022 <a href=\"#dataclasses\">dataclasses<\/a> \u2022 <a href=\"#datetime\">datetime<\/a> \u2022 <a href=\"#fractions\">fractions<\/a> \u2022 <a href=\"#functools\">functools<\/a> \u2022 <a href=\"#glob\">glob<\/a> \u2022 <a href=\"#graphlib\">graphlib<\/a> \u2022 <a href=\"#itertools\">itertools<\/a> \u2022 <a href=\"#math\">math<\/a> \u2022 <a href=\"#random\">random<\/a> \u2022 <a href=\"#shlex\">shlex<\/a> \u2022 <a href=\"#shutil\">shutil<\/a> \u2022 <a href=\"#statistics\">statistics<\/a> \u2022 <a href=\"#zoneinfo\">zoneinfo<\/a><\/p>\n<p>  <\/p>\n<p>\u0412\u0441\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0440\u0430\u0431\u043e\u0447\u0438\u0435. \u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u0432 \u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0435 (\u0441\u0441\u044b\u043b\u043a\u0438 \u043f\u043e\u0434 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438), \u043b\u0438\u0431\u043e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e. \u0415\u0441\u043b\u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0443 \u0432\u0430\u0441 \u0441\u0442\u0430\u0440\u044b\u0439 Python \u2014 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0439\u0442\u0435 \u0447\u0435\u0440\u0435\u0437 Docker:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ docker run -it --rm python:3.10-alpine<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"array\">array<\/h2>\n<p>  <\/p>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c <a href=\"https:\/\/docs.python.org\/3\/library\/array\" rel=\"nofollow noopener noreferrer\"><code>array<\/code><\/a> \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u044b\u0435 \u043e\u0434\u043d\u043e\u0442\u0438\u043f\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0440\u0435\u0436\u0435, \u0447\u0435\u043c \u0437\u043d\u0430\u043c\u0435\u043d\u0438\u0442\u044b\u0439 \u0441\u043e\u0431\u0440\u0430\u0442 <code>list<\/code>.<\/p>\n<p>  <\/p>\n<p>\u041c\u0435\u0442\u043e\u0434 <a href=\"https:\/\/docs.python.org\/3\/library\/array#array.array.index\" rel=\"nofollow noopener noreferrer\"><code>array.index()<\/code><\/a> \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0438\u043d\u0434\u0435\u043a\u0441 \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430. \u0422\u0435\u043f\u0435\u0440\u044c \u043e\u043d \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b <code>start<\/code> \u0438 <code>stop<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0434\u0430\u044e\u0442 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u043f\u043e\u0438\u0441\u043a\u0430 (3.10+):<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">from array import array arr = array(\"i\", [7, 11, 19, 42])  idx = arr.index(11) # idx == 1  idx = arr.index(11, 2) # ValueError: array.index(x): x not in array<\/code><\/pre>\n<p>  <\/p>\n<p><a href=\"https:\/\/stepik.org\/lesson\/716879\/step\/2\" rel=\"nofollow noopener noreferrer\">\u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430<\/a><\/p>\n<p>  <\/p>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438: <a href=\"https:\/\/github.com\/Phaqui\" rel=\"nofollow noopener noreferrer\">Anders Lorentsen<\/a> \u2022 <a href=\"https:\/\/github.com\/ZackerySpytz\" rel=\"nofollow noopener noreferrer\">Zackery Spytz<\/a><\/p>\n<p>  <\/p>\n<h2 id=\"base64\">base64<\/h2>\n<p>  <\/p>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c <a href=\"https:\/\/docs.python.org\/3\/library\/base64\" rel=\"nofollow noopener noreferrer\"><code>base64<\/code><\/a> \u043a\u043e\u0434\u0438\u0440\u0443\u0435\u0442 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 ASCII-\u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430\u043c Base16, Base32 \u0438 Base64.<\/p>\n<p>  <\/p>\n<p>\u041e\u043d \u043e\u0431\u0437\u0430\u0432\u0435\u043b\u0441\u044f \u043f\u0430\u0440\u043e\u0439 \u043d\u043e\u0432\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 <a href=\"https:\/\/docs.python.org\/3\/library\/base64#base64.b32hexencode\" rel=\"nofollow noopener noreferrer\"><code>b32hexencode()<\/code><\/a> \u0438 <a href=\"https:\/\/docs.python.org\/3\/library\/base64#base64.b32hexdecode\" rel=\"nofollow noopener noreferrer\"><code>b32hexdecode()<\/code><\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u044b\u0439 32-\u0441\u0438\u043c\u0432\u043e\u043b\u044c\u043d\u044b\u0439 \u0430\u043b\u0444\u0430\u0432\u0438\u0442 \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e <a href=\"https:\/\/datatracker.ietf.org\/doc\/html\/rfc4648.html#section-7\" rel=\"nofollow noopener noreferrer\">RFC 4648<\/a> (3.10+):<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">import base64 bytes = b\"python is awesome\"  base64.b32encode(bytes) # b'OB4XI2DPNYQGS4ZAMF3WK43PNVSQ===='  base64.b32hexencode(bytes) # b'E1SN8Q3FDOG6ISP0C5RMASRFDLIG===='<\/code><\/pre>\n<p>  <\/p>\n<p><a href=\"https:\/\/stepik.org\/lesson\/716879\/step\/3\" rel=\"nofollow noopener noreferrer\">\u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430<\/a><\/p>\n<p>  <\/p>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a: <a href=\"https:\/\/github.com\/FFY00\" rel=\"nofollow noopener noreferrer\">Filipe La\u00edns<\/a><\/p>\n<p>  <\/p>\n<h2 id=\"bisect\">bisect<\/h2>\n<p>  <\/p>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c <a href=\"https:\/\/docs.python.org\/3\/library\/bisect\" rel=\"nofollow noopener noreferrer\"><code>bisect<\/code><\/a> \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0441\u043f\u0438\u0441\u043a\u0430\u043c\u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430. \u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/docs.python.org\/3\/library\/bisect#bisect.bisect\" rel=\"nofollow noopener noreferrer\"><code>bisect()<\/code><\/a> \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u0441\u043f\u0438\u0441\u043a\u0435;<\/li>\n<li><a href=\"https:\/\/docs.python.org\/3\/library\/bisect#bisect.insort\" rel=\"nofollow noopener noreferrer\"><code>insort()<\/code><\/a> \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442, \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u044f \u043f\u043e\u0440\u044f\u0434\u043e\u043a.<\/li>\n<\/ul>\n<p>  <\/p>\n<pre><code class=\"python\">import bisect  lst = [7, 11, 19, 42] idx = bisect.bisect(lst, 12) # idx == 2  bisect.insort(lst, 12) # [7, 11, 12, 19, 42]<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421 \u0432\u0435\u0440\u0441\u0438\u0438 3.10 \u0432\u0441\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>key<\/code>. \u042d\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0441\u043f\u0438\u0441\u043a\u0430. \u0423\u0434\u043e\u0431\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043d\u0435\u0441\u0440\u0430\u0432\u043d\u0438\u043c\u044b:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">import bisect import operator  p1 = {\"id\": 11, \"name\": \"Diane\"} p2 = {\"id\": 12, \"name\": \"Bob\"} p3 = {\"id\": 13, \"name\": \"Emma\"}  key = operator.itemgetter(\"name\") people = sorted([p1, p2, p3], key=key) # Bob, Diane, Emma  idx = bisect.bisect(people, \"Dan\") # TypeError: '&lt;' not supported between instances of 'str' and 'dict'  idx = bisect.bisect(people, \"Dan\", key=key) # idx == 1<\/code><\/pre>\n<p>  <\/p>\n<p><a href=\"https:\/\/stepik.org\/lesson\/716879\/step\/4\" rel=\"nofollow noopener noreferrer\">\u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430<\/a><\/p>\n<p>  <\/p>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a: <a href=\"https:\/\/github.com\/rhettinger\" rel=\"nofollow noopener noreferrer\">Raymond Hettinger<\/a><\/p>\n<p>  <\/p>\n<h2 id=\"builtins\">builtins<\/h2>\n<p>  <\/p>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c <a href=\"https:\/\/docs.python.org\/3\/library\/builtins\" rel=\"nofollow noopener noreferrer\"><code>builtins<\/code><\/a> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432\u0441\u0435 \u00ab\u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435\u00bb \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u043a\u043b\u0430\u0441\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0431\u0435\u0437 \u0432\u0441\u044f\u043a\u0438\u0445 \u0438\u043c\u043f\u043e\u0440\u0442\u043e\u0432: <code>int<\/code>, <code>list<\/code>, <code>len()<\/code>, <code>open()<\/code> \u0438 \u0442\u043e\u043c\u0443 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435.<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">import builtins  list is builtins.list # True  len is builtins.len # True<\/code><\/pre>\n<p>  <\/p>\n<p>\u0423 <strong>\u0441\u0442\u0440\u043e\u043a\u0438<\/strong> \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u043c\u0435\u0442\u043e\u0434\u044b <a href=\"https:\/\/docs.python.org\/3\/library\/stdtypes#str.removeprefix\" rel=\"nofollow noopener noreferrer\"><code>str.removeprefix()<\/code><\/a> \u0438 <a href=\"https:\/\/docs.python.org\/3\/library\/stdtypes#str.removesuffix\" rel=\"nofollow noopener noreferrer\"><code>str.removesuffix()<\/code><\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u0440\u0435\u0437\u0430\u044e\u0442 \u0433\u043e\u043b\u043e\u0432\u0443 \u0438 \u0445\u0432\u043e\u0441\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e (3.9+):<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">s = \"Python is awesome\"  s.removeprefix(\"Python is \") # 'awesome'  s.removesuffix(\" is awesome\") # 'Python'<\/code><\/pre>\n<p>  <\/p>\n<p>\u0423 <strong>\u0446\u0435\u043b\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430<\/strong> \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0441\u044f \u043c\u0435\u0442\u043e\u0434 <a href=\"https:\/\/docs.python.org\/3\/library\/stdtypes#int.bit_count\" rel=\"nofollow noopener noreferrer\"><code>int.bit_count()<\/code><\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0435\u0434\u0438\u043d\u0438\u0446 \u0432 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0447\u0438\u0441\u043b\u0430 (3.10+):<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">n = 42  bin(n) # '0b101010'  n.bit_count() # 3<\/code><\/pre>\n<p>  <\/p>\n<p>\u041c\u0435\u0442\u043e\u0434\u044b <strong>\u0441\u043b\u043e\u0432\u0430\u0440\u044f<\/strong> <code>dict.keys()<\/code>, <code>dict.values()<\/code> \u0438 <code>dict.items()<\/code> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u043e\u0431\u044a\u0435\u043a\u0442\u044b-\u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f (view objects), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0434\u0443\u0431\u043b\u0438\u0440\u0443\u044e\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u043b\u043e\u0432\u0430\u0440\u044f, \u0430 \u0441\u0441\u044b\u043b\u0430\u044e\u0442\u0441\u044f \u043d\u0430 \u043d\u0438\u0445. \u0420\u0430\u043d\u044c\u0448\u0435 \u0438\u0437 \u044d\u0442\u0438\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043d\u0435\u043b\u044c\u0437\u044f \u0431\u044b\u043b\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0431\u0440\u0430\u0442\u043d\u0443\u044e \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0441\u043b\u043e\u0432\u0430\u0440\u044c, \u0430 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u2014\u00a0\u0447\u0435\u0440\u0435\u0437 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <code>.mapping<\/code> (3.10+):<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">people = {     \"Diane\": 70,     \"Bob\": 78,     \"Emma\": 84 }  keys = people.keys() # dict_keys(['Diane', 'Bob', 'Emma'])  keys.mapping[\"Bob\"] # 78<\/code><\/pre>\n<p>  <\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <strong>\u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0439<\/strong> <a href=\"https:\/\/docs.python.org\/3\/library\/functions#zip\" rel=\"nofollow noopener noreferrer\"><code>zip()<\/code><\/a> \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>strict<\/code>. \u041e\u043d \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u0447\u0442\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0439 \u0434\u043b\u0438\u043d\u044b (3.10+):<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">keys = [\"Diane\", \"Bob\", \"Emma\"] vals = [70, 78, 84, 42]  pairs = zip(keys, vals) list(pairs) # [('Diane', 70), ('Bob', 78), ('Emma', 84)]  pairs = zip(keys, vals, strict=True) list(pairs) # ValueError: zip() argument 2 is longer than argument 1<\/code><\/pre>\n<p>  <\/p>\n<p><a href=\"https:\/\/stepik.org\/lesson\/716879\/step\/5\" rel=\"nofollow noopener noreferrer\">\u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430<\/a><\/p>\n<p>  <\/p>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438: <a href=\"https:\/\/github.com\/sweeneyde\" rel=\"nofollow noopener noreferrer\">Dennis Sweeney<\/a> \u2022 <a href=\"https:\/\/github.com\/niklasf\" rel=\"nofollow noopener noreferrer\">Niklas Fiekas<\/a> \u2022 <a href=\"https:\/\/github.com\/brandtbucher\" rel=\"nofollow noopener noreferrer\">Brandt Bucher<\/a><\/p>\n<p>  <\/p>\n<h2 id=\"dataclasses\">dataclasses<\/h2>\n<p>  <\/p>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c <a href=\"https:\/\/docs.python.org\/3\/library\/dataclasses\" rel=\"nofollow noopener noreferrer\"><code>dataclasses<\/code><\/a> \u0433\u0435\u043d\u0435\u0440\u0438\u0442 \u043a\u043b\u0430\u0441\u0441\u044b \u043f\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.<\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u0442\u0430\u043a\u043b\u0430\u0441\u0441\u044b \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/docs.python.org\/3\/reference\/datamodel.html#slots\" rel=\"nofollow noopener noreferrer\"><code>\u0441\u043b\u043e\u0442\u044b<\/code><\/a> (slots) \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0441 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432 (3.10+).<\/p>\n<p>  <\/p>\n<p>\u041e\u0431\u044b\u0447\u043d\u044b\u0439 \u0434\u0430\u0442\u0430\u043a\u043b\u0430\u0441\u0441:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">from dataclasses import dataclass  @dataclass class Person:     id: int     name: str  diane = Person(id=11, name=\"Diane\") diane.__dict__ # {'id': 11, 'name': 'Diane'} diane.salary = 70 # ok<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u043e \u0441\u043b\u043e\u0442\u0430\u043c\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">from dataclasses import dataclass  @dataclass(slots=True) class SlotPerson:     id: int     name: str  bob = SlotPerson(id=12, name=\"Bob\") bob.__dict__ # AttributeError: 'SlotPerson' object has no attribute '__dict__' bob.__slots__ # ('id', 'name') bob.salary = 78 # AttributeError: 'SlotPerson' object has no attribute 'salary'<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0434\u0430\u0442\u0430\u043a\u043b\u0430\u0441\u0441 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u043d\u044b\u0435 (keyword-only) \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 (3.10+):<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">from dataclasses import dataclass  @dataclass(kw_only=True) class KeywordPerson:     id: int     name: str  diane = KeywordPerson(id=11, name=\"Diane\") # ok diane = KeywordPerson(11, \"Diane\") # TypeError: KeywordPerson.__init__() takes 1 positional argument but 3 were given<\/code><\/pre>\n<p>  <\/p>\n<p><a href=\"https:\/\/stepik.org\/lesson\/716879\/step\/6\" rel=\"nofollow noopener noreferrer\">\u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430<\/a><\/p>\n<p>  <\/p>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438: <a href=\"https:\/\/github.com\/uriyyo\" rel=\"nofollow noopener noreferrer\">Yurii Karabas<\/a> \u2022 <a href=\"https:\/\/github.com\/ericvsmith\" rel=\"nofollow noopener noreferrer\">Eric V. Smith<\/a><\/p>\n<p>  <\/p>\n<h2 id=\"datetime\">datetime<\/h2>\n<p>  <\/p>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c <a href=\"https:\/\/docs.python.org\/3\/library\/datetime\" rel=\"nofollow noopener noreferrer\"><code>datetime<\/code><\/a> \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0434\u0430\u0442\u043e\u0439 \u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c.<\/p>\n<p>  <\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043b\u0438\u0441\u044c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u044b <a href=\"https:\/\/docs.python.org\/3\/library\/datetime#datetime.date.fromisocalendar\" rel=\"nofollow noopener noreferrer\"><code>date.fromisocalendar()<\/code><\/a> \u0438 <a href=\"https:\/\/docs.python.org\/3\/library\/datetime#datetime.datetime.fromisocalendar\" rel=\"nofollow noopener noreferrer\"><code>datetime.fromisocalendar()<\/code><\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0437\u0434\u0430\u044e\u0442 \u0434\u0430\u0442\u0443 \u0438\u0437 \u0442\u0440\u043e\u0438\u0446\u044b <code>(\u0433\u043e\u0434, \u043d\u0435\u0434\u0435\u043b\u044f, \u0434\u0435\u043d\u044c_\u043d\u0435\u0434\u0435\u043b\u0438)<\/code> (3.8+):<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">import datetime as dt  day = dt.date(2022, 9, 13) day.isocalendar() # datetime.IsoCalendarDate(year=2022, week=37, weekday=2)  year, week, day = day.isocalendar() next_day = dt.date.fromisocalendar(year, week, day+1) # datetime.date(2022, 9, 14)<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043c\u0435\u0442\u043e\u0434 <code>.isocalendar()<\/code> \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0435 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u043a\u043e\u0440\u0442\u0435\u0436, \u0430 \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0439 <code>IsoCalendarDate<\/code> (3.9+). \u042d\u0442\u043e \u0432\u0438\u0434\u043d\u043e \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u044b\u0448\u0435.<\/p>\n<p>  <\/p>\n<p><a href=\"https:\/\/stepik.org\/lesson\/716879\/step\/7\" rel=\"nofollow noopener noreferrer\">\u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430<\/a><\/p>\n<p>  <\/p>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438: <a href=\"https:\/\/github.com\/pganssle\" rel=\"nofollow noopener noreferrer\">Paul Ganssle<\/a> \u2022 <a href=\"https:\/\/github.com\/corona10\" rel=\"nofollow noopener noreferrer\">Dong-hee Na<\/a><\/p>\n<p>  <\/p>\n<h2 id=\"fractions\">fractions<\/h2>\n<p>  <\/p>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c <a href=\"https:\/\/docs.python.org\/3\/library\/fractions\" rel=\"nofollow noopener noreferrer\"><code>fractions<\/code><\/a> \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0440\u0430\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0447\u0438\u0441\u043b\u0430\u043c\u0438.<\/p>\n<p>  <\/p>\n<p>\u041e\u043d \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u043c\u0435\u0442\u043e\u0434 <a href=\"https:\/\/docs.python.org\/3\/library\/fractions#fractions.Fraction.as_integer_ratio\" rel=\"nofollow noopener noreferrer\"><code>Fraction.as_integer_ratio()<\/code><\/a> \u0438 \u043d\u0430\u0443\u0447\u0438\u043b\u0441\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0434\u0440\u043e\u0431\u044c \u043a\u0430\u043a \u043f\u0430\u0440\u0443 <code>(\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c, \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u044c)<\/code>, \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0432 \u0432\u0435\u043a\u043e\u0432\u043e\u0439 \u043f\u043e\u0437\u043e\u0440 \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e <code>float<\/code> (3.8+):<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">(0.25).as_integer_ratio() # (1, 4)  (0.5).as_integer_ratio() # (1, 2)  (0.2).as_integer_ratio() # (3602879701896397, 18014398509481984) # oopsie<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\">from fractions import Fraction  Fraction(\"0.2\").as_integer_ratio() # (1, 5) # so much better<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u043f\u0440\u0430\u0432\u0435\u0434\u043b\u0438\u0432\u043e\u0441\u0442\u0438 \u0440\u0430\u0434\u0438, <code>decimal.Decimal<\/code> \u043d\u0430\u0443\u0447\u0438\u043b\u0441\u044f \u0442\u0430\u043a \u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0449\u0435 \u0432 3.6. \u041d\u043e \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u043f\u0440\u0438\u044f\u0442\u043d\u043e.<\/p>\n<p>  <\/p>\n<p><a href=\"https:\/\/stepik.org\/lesson\/716879\/step\/8\" rel=\"nofollow noopener noreferrer\">\u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430<\/a><\/p>\n<p>  <\/p>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438: <a href=\"https:\/\/github.com\/lisroach\" rel=\"nofollow noopener noreferrer\">Lisa Roach<\/a> \u2022 <a href=\"https:\/\/github.com\/rhettinger\" rel=\"nofollow noopener noreferrer\">Raymond Hettinger<\/a><\/p>\n<p>  <\/p>\n<h2 id=\"functools\">functools<\/h2>\n<p>  <\/p>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c <a href=\"https:\/\/docs.python.org\/3\/library\/functools\" rel=\"nofollow noopener noreferrer\"><code>functools<\/code><\/a> \u2014 \u0441\u0431\u043e\u0440\u043d\u0438\u043a \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432\u044b\u0441\u0448\u0435\u0433\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0430. \u041e\u0434\u043d\u0430 \u0438\u0437 \u043d\u0438\u0445 \u2014\u00a0<a href=\"https:\/\/docs.python.org\/3\/library\/functools#functools.lru_cache\" rel=\"nofollow noopener noreferrer\"><code>lru_cache()<\/code><\/a>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043a\u0435\u0448\u0438\u0440\u0443\u0435\u0442 \u0434\u043e\u0440\u043e\u0433\u0438\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">import functools import time  @functools.lru_cache(maxsize=256) def find_user(name):     # imitating slow search     time.sleep(1)     user = {\"id\": 11, \"name\": \"Diane\"}     return user  find_user(\"Diane\") # kinda slow  find_user(\"Diane\") # blazingly fast<\/code><\/pre>\n<p>  <\/p>\n<p>\u0420\u0430\u043d\u044c\u0448\u0435 \u0443 \u043d\u0435\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u043a\u0435\u0448\u0430. \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c <code>@lru_cache<\/code> \u0431\u0435\u0437 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0438 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0443\u043c\u043e\u043b\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 <code>128<\/code> (3.8+).<\/p>\n<p>  <\/p>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043c\u043e\u0436\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043a\u0435\u0448\u0430 (3.9+):<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">find_user.cache_parameters() # {'maxsize': 256, 'typed': False}<\/code><\/pre>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u043f\u0430\u043c\u044f\u0442\u0438 \u0432\u0430\u043c \u043d\u0435 \u0436\u0430\u043b\u043a\u043e, \u0432\u043c\u0435\u0441\u0442\u043e <code>@lru_cache<\/code> \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/docs.python.org\/3\/library\/functools#functools.cache\" rel=\"nofollow noopener noreferrer\"><code>@cache<\/code><\/a> \u2014 \u043e\u043d \u0431\u0435\u0437\u0440\u0430\u0437\u043c\u0435\u0440\u043d\u044b\u0439 (3.9+).<\/p>\n<p>  <\/p>\n<p>\u041d\u043e\u0432\u044b\u0439 \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440 <a href=\"https:\/\/docs.python.org\/3\/library\/functools#functools.cached_property\" rel=\"nofollow noopener noreferrer\"><code>@cached_property<\/code><\/a> \u043a\u0435\u0448\u0438\u0440\u0443\u0435\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 (3.8+):<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">import functools import statistics  class Dataset:     def __init__(self, seq):         self._data = tuple(seq)      @functools.cached_property     def stdev(self):         return statistics.stdev(self._data)  dataset = Dataset(range(1_000_000))  dataset.stdev # kinda slow  dataset.stdev # blazingly fast<\/code><\/pre>\n<p>  <\/p>\n<p>\u0410 <a href=\"https:\/\/docs.python.org\/3\/library\/functools#functools.singledispatchmethod\" rel=\"nofollow noopener noreferrer\"><code>@singledispatchmethod<\/code><\/a> \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u043c\u0435\u0442\u043e\u0434\u0430 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u0438\u043f\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 (3.8+):<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">import functools  class Divider:     @functools.singledispatchmethod     def divide(self, dividend, divisor):         raise NotImplementedError(\"Do not know how to divide those\")      @divide.register     def _(self, dividend: int, divisor: int):         return dividend \/\/ divisor      @divide.register     def _(self, dividend: str, divisor: int):         # this is really stupid, I know         newlen = len(dividend) \/\/ divisor         return dividend[:newlen]  divider = Divider() divider.divide(10, 2) # 5  divider.divide(\"hello world\", 2) # 'hello'<\/code><\/pre>\n<p>  <\/p>\n<p>\u0427\u0443\u0432\u0441\u0442\u0432\u0443\u0435\u0442\u0435, \u0434\u0436\u0430\u0432\u043e\u0439 \u043f\u043e\u0442\u044f\u043d\u0443\u043b\u043e?<\/p>\n<p>  <\/p>\n<p><a href=\"https:\/\/stepik.org\/lesson\/716879\/step\/9\" rel=\"nofollow noopener noreferrer\">\u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430<\/a><\/p>\n<p>  <\/p>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438: <a href=\"https:\/\/github.com\/rhettinger\" rel=\"nofollow noopener noreferrer\">Raymond Hettinger<\/a> \u2022 <a href=\"https:\/\/github.com\/carljm\" rel=\"nofollow noopener noreferrer\">Carl Meyer<\/a> \u2022 <a href=\"https:\/\/github.com\/ethanhs\" rel=\"nofollow noopener noreferrer\">Ethan Smith<\/a><\/p>\n<p>  <\/p>\n<h2 id=\"glob\">glob<\/h2>\n<p>  <\/p>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c <a href=\"https:\/\/docs.python.org\/3\/library\/glob\" rel=\"nofollow noopener noreferrer\"><code>glob<\/code><\/a> \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u0444\u0430\u0439\u043b\u044b \u0438 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0438, \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u043f\u043e\u0434 \u0448\u0430\u0431\u043b\u043e\u043d.<\/p>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0443 <code>root_dir<\/code> \u0432 <a href=\"https:\/\/docs.python.org\/3\/library\/glob#glob.glob\" rel=\"nofollow noopener noreferrer\"><code>glob()<\/code><\/a> \u0438 <a href=\"https:\/\/docs.python.org\/3\/library\/glob#glob.iglob\" rel=\"nofollow noopener noreferrer\"><code>iglob()<\/code><\/a> \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u043e\u0440\u043d\u0435\u0432\u0443\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u043f\u043e\u0438\u0441\u043a\u0430 (3.10+):<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">import glob import os  os.getcwd() # '\/'  glob.glob(\"*\", root_dir=\"\/usr\") # ['local', 'share', 'bin', 'lib', 'sbin', 'src']<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0443\u0441\u0442\u044f\u0447\u043e\u043a, \u0430 \u043f\u0440\u0438\u044f\u0442\u043d\u043e.<\/p>\n<p>  <\/p>\n<p><a href=\"https:\/\/stepik.org\/lesson\/716879\/step\/10\" rel=\"nofollow noopener noreferrer\">\u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430<\/a><\/p>\n<p>  <\/p>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a: <a href=\"https:\/\/github.com\/serhiy-storchaka\" rel=\"nofollow noopener noreferrer\">Serhiy Storchaka<\/a><\/p>\n<p>  <\/p>\n<h2 id=\"graphlib\">graphlib<\/h2>\n<p>  <\/p>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c <a href=\"https:\/\/docs.python.org\/3\/library\/graphlib\" rel=\"nofollow noopener noreferrer\"><code>graphlib<\/code><\/a> \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0433\u0440\u0430\u0444\u0430\u043c\u0438. \u0418 \u0437\u043d\u0430\u0435\u0442\u0435 \u0447\u0442\u043e? \u042d\u0442\u043e \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043d\u043e\u0432\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c! (3.9+)<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u043a\u0430 \u0443 \u043d\u0435\u0433\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u2014\u00a0\u0442\u043e\u043f\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0433\u0440\u0430\u0444\u043e\u0432 (\u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0432\u0435\u0440\u0448\u0438\u043d, \u0447\u0442\u043e \u0434\u043b\u044f \u043b\u044e\u0431\u044b\u0445 <code>u \u2192 v<\/code>, \u0432\u0435\u0440\u0448\u0438\u043d\u0430 <code>u<\/code> \u0438\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434 <code>v<\/code>):<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">from graphlib import TopologicalSorter  graph = {\"Diane\": {\"Bob\", \"Cindy\"}, \"Cindy\": {\"Alice\"}, \"Bob\": {\"Alice\"}} # Alice \u2192 Bob \u2192 Diane #     \u21b3 Cindy \u2197  sorter = TopologicalSorter(graph) list(sorter.static_order()) # ['Alice', 'Cindy', 'Bob', 'Diane']<\/code><\/pre>\n<p>  <\/p>\n<p><a href=\"https:\/\/stepik.org\/lesson\/716898\/step\/2\" rel=\"nofollow noopener noreferrer\">\u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430<\/a><\/p>\n<p>  <\/p>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438: <a href=\"https:\/\/github.com\/pablogsal\" rel=\"nofollow noopener noreferrer\">Pablo Galindo<\/a> \u2022 <a href=\"https:\/\/github.com\/tim-one\" rel=\"nofollow noopener noreferrer\">Tim Peters<\/a> \u2022 <a href=\"https:\/\/github.com\/larryhastings\" rel=\"nofollow noopener noreferrer\">Larry Hastings<\/a><\/p>\n<p>  <\/p>\n<h2 id=\"itertools\">itertools<\/h2>\n<p>  <\/p>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c <a href=\"https:\/\/docs.python.org\/3\/library\/itertools\" rel=\"nofollow noopener noreferrer\"><code>itertools<\/code><\/a> \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0435 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u0434\u043b\u044f \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f\u043c\u0438 (\u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438).<\/p>\n<p>  <\/p>\n<p>\u041e\u0434\u043d\u0430 \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u2014 <a href=\"https:\/\/docs.python.org\/3\/library\/itertools#itertools.accumulate\" rel=\"nofollow noopener noreferrer\"><code>accumulate()<\/code><\/a> \u2014 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0441\u043a\u043e\u043b\u044c\u0437\u044f\u0449\u0438\u0439 \u0430\u0433\u0440\u0435\u0433\u0430\u0442. \u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0435\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>initial<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0434\u0430\u0435\u0442 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 (3.8+):<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">import itertools  seq = [7, 11, 19, 42]  accumulator = itertools.accumulate(seq) list(accumulator) # [7, 18, 37, 79]  accumulator = itertools.accumulate(seq, initial=100) list(accumulator) # [100, 107, 118, 137, 179]<\/code><\/pre>\n<p>  <\/p>\n<p>\u0410 \u043d\u043e\u0432\u0430\u044f \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f <a href=\"https:\/\/docs.python.org\/3\/library\/itertools#itertools.pairwise\" rel=\"nofollow noopener noreferrer\"><code>pairwise()<\/code><\/a> \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u043f\u043e \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u0430\u0440\u044b \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 (3.10+):<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">import itertools  seq = [7, 11, 19, 42] pairer = itertools.pairwise(seq)  list(pairer) # [(7, 11), (11, 19), (19, 42)]<\/code><\/pre>\n<p>  <\/p>\n<p><a href=\"https:\/\/stepik.org\/lesson\/716898\/step\/3\" rel=\"nofollow noopener noreferrer\">\u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430<\/a><\/p>\n<p>  <\/p>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438: <a href=\"https:\/\/github.com\/lisroach\" rel=\"nofollow noopener noreferrer\">Lisa Roach<\/a> \u2022 <a href=\"https:\/\/github.com\/rhettinger\" rel=\"nofollow noopener noreferrer\">Raymond Hettinger<\/a><\/p>\n<p>  <\/p>\n<h2 id=\"math\">math<\/h2>\n<p>  <\/p>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c <a href=\"https:\/\/docs.python.org\/3\/library\/math\" rel=\"nofollow noopener noreferrer\"><code>math<\/code><\/a> \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432\u0430\u0433\u043e\u043d \u0438 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0443\u044e \u0442\u0435\u043b\u0435\u0436\u043a\u0443 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439.<\/p>\n<p>  <\/p>\n<p>\u0422\u0443\u0442 \u043c\u043d\u043e\u0433\u043e \u043d\u043e\u0432\u043e\u0433\u043e:<\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/docs.python.org\/3\/library\/math#math.dist\" rel=\"nofollow noopener noreferrer\"><code>dist()<\/code><\/a> \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u0435\u0432\u043a\u043b\u0438\u0434\u043e\u0432\u043e \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u0442\u043e\u0447\u043a\u0430\u043c\u0438 (3.8+);<\/li>\n<li><a href=\"https:\/\/docs.python.org\/3\/library\/math#math.perm\" rel=\"nofollow noopener noreferrer\"><code>perm()<\/code><\/a> \u0438 <a href=\"https:\/\/docs.python.org\/3\/library\/math#math.comb\" rel=\"nofollow noopener noreferrer\"><code>comb()<\/code><\/a> \u0441\u0447\u0438\u0442\u0430\u044e\u0442 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0438 \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u044f (3.8+);<\/li>\n<li><a href=\"https:\/\/docs.python.org\/3\/library\/math#math.lcm\" rel=\"nofollow noopener noreferrer\"><code>lcm()<\/code><\/a> \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0435\u0435 \u043e\u0431\u0449\u0435\u0435 \u043a\u0440\u0430\u0442\u043d\u043e\u0435 (3.9+);<\/li>\n<li><a href=\"https:\/\/docs.python.org\/3\/library\/math#math.gcd\" rel=\"nofollow noopener noreferrer\"><code>gcd()<\/code><\/a> \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u0439 \u043e\u0431\u0449\u0438\u0439 \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c \u0434\u043b\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 (3.9+).<\/li>\n<\/ul>\n<p>  <\/p>\n<pre><code class=\"python\">import math  math.dist((1,1), (4, 5)) # 5.0  math.perm(5, 2) # 20  math.comb(5, 2) # 10  math.lcm(9, 27, 60) # 540  math.gcd(9, 27, 60) # 3<\/code><\/pre>\n<p>  <\/p>\n<p>\u0410 <a href=\"https:\/\/docs.python.org\/3\/library\/math#math.prod\" rel=\"nofollow noopener noreferrer\"><code>prod()<\/code><\/a> \u043f\u0435\u0440\u0435\u043c\u043d\u043e\u0436\u0430\u0435\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 (3.8+):<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">import math  seq = range(3, 9) math.prod(seq) # 20160<\/code><\/pre>\n<p>  <\/p>\n<p><a href=\"https:\/\/stepik.org\/lesson\/716898\/step\/4\" rel=\"nofollow noopener noreferrer\">\u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430<\/a><\/p>\n<p>  <\/p>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438: <a href=\"https:\/\/github.com\/rhettinger\" rel=\"nofollow noopener noreferrer\">Raymond Hettinger<\/a> \u2022 <a href=\"https:\/\/github.com\/FR4NKESTI3N\" rel=\"nofollow noopener noreferrer\">Yash Aggarwal<\/a> \u2022 <a href=\"https:\/\/github.com\/KellerFuchs\" rel=\"nofollow noopener noreferrer\">Keller Fuchs<\/a> \u2022 <a href=\"https:\/\/github.com\/serhiy-storchaka\" rel=\"nofollow noopener noreferrer\">Serhiy Storchaka<\/a> \u2022 <a href=\"https:\/\/github.com\/mdickinson\" rel=\"nofollow noopener noreferrer\">Mark Dickinson<\/a> \u2022 <a href=\"https:\/\/github.com\/ananthan-123\" rel=\"nofollow noopener noreferrer\">Ananthakrishnan<\/a> \u2022 <a href=\"https:\/\/github.com\/pablogsal\" rel=\"nofollow noopener noreferrer\">Pablo Galindo<\/a><\/p>\n<p>  <\/p>\n<h2 id=\"random\">random<\/h2>\n<p>  <\/p>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c <a href=\"https:\/\/docs.python.org\/3\/library\/random\" rel=\"nofollow noopener noreferrer\"><code>random<\/code><\/a> \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u0447\u0438\u0441\u043b\u0430\u043c\u0438.<\/p>\n<p>  <\/p>\n<p>\u041d\u043e\u0432\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 <a href=\"https:\/\/docs.python.org\/3\/library\/random#random.randbytes\" rel=\"nofollow noopener noreferrer\"><code>randbytes()<\/code><\/a> \u0433\u0435\u043d\u0435\u0440\u0438\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u0443\u044e \u0431\u0430\u0439\u0442\u043e\u0432\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 (3.9+):<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">import random  random.randbytes(4) # b'\\x8b\\xd4\\x8f\\xc9'<\/code><\/pre>\n<p>  <\/p>\n<p><a href=\"https:\/\/stepik.org\/lesson\/716898\/step\/5\" rel=\"nofollow noopener noreferrer\">\u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430<\/a><\/p>\n<p>  <\/p>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a: <a href=\"https:\/\/github.com\/vstinner\" rel=\"nofollow noopener noreferrer\">Victor Stinner<\/a><\/p>\n<p>  <\/p>\n<h2 id=\"shlex\">shlex<\/h2>\n<p>  <\/p>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c <a href=\"https:\/\/docs.python.org\/3\/library\/shlex\" rel=\"nofollow noopener noreferrer\"><code>shlex<\/code><\/a> \u0431\u044c\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443 \u043d\u0430 \u0442\u043e\u043a\u0435\u043d\u044b \u043f\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 Unix.<\/p>\n<p>  <\/p>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u044c\u0435\u0442, \u043d\u043e \u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u0442 \u2014\u00a0\u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <a href=\"https:\/\/docs.python.org\/3\/library\/shlex#shlex.join\" rel=\"nofollow noopener noreferrer\"><code>join()<\/code><\/a> (3.8+):<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">import shlex  tokens = [\"echo\", \"-n\", \"Python is awesome\"] shlex.join(tokens) # \"echo -n 'Python is awesome'\"<\/code><\/pre>\n<p>  <\/p>\n<p><a href=\"https:\/\/stepik.org\/lesson\/716898\/step\/6\" rel=\"nofollow noopener noreferrer\">\u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430<\/a><\/p>\n<p>  <\/p>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a: <a href=\"https:\/\/github.com\/bbayles\" rel=\"nofollow noopener noreferrer\">Bo Bayles<\/a><\/p>\n<p>  <\/p>\n<h2 id=\"shutil\">shutil<\/h2>\n<p>  <\/p>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c <a href=\"https:\/\/docs.python.org\/3\/library\/shutil\" rel=\"nofollow noopener noreferrer\"><code>shutil<\/code><\/a> \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u0438 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430\u043c\u0438: \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442, \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442, \u0443\u0434\u0430\u043b\u044f\u0435\u0442.<\/p>\n<p>  <\/p>\n<p>\u0418 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u0442\u0430\u043b\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u2014\u00a0\u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0443 <code>dirs_exist_ok<\/code> \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <a href=\"https:\/\/docs.python.org\/3\/library\/shutil#shutil.copytree\" rel=\"nofollow noopener noreferrer\"><code>copytree()<\/code><\/a> (3.8+). \u0421 \u043d\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043d\u0435 \u0441\u043b\u043e\u043c\u0430\u0435\u0442\u0441\u044f, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">from pathlib import Path import shutil  tmp = Path(\"\/tmp\")  src = tmp.joinpath(\"src\") src.mkdir() src.joinpath(\"src.txt\").touch() # \/tmp\/src # \/tmp\/src\/src.txt  dst = tmp.joinpath(\"dst\") dst.mkdir() # \/tmp\/dst  shutil.copytree(src, dst) # FileExistsError: [Errno 17] File exists: '\/tmp\/dst' shutil.copytree(src, dst, dirs_exist_ok=True) # PosixPath('\/tmp\/dst')<\/code><\/pre>\n<p>  <\/p>\n<p><a href=\"https:\/\/stepik.org\/lesson\/716898\/step\/7\" rel=\"nofollow noopener noreferrer\">\u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430<\/a><\/p>\n<p>  <\/p>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a: <a href=\"https:\/\/github.com\/jab\" rel=\"nofollow noopener noreferrer\">Josh Bronson<\/a><\/p>\n<p>  <\/p>\n<h2 id=\"statistics\">statistics<\/h2>\n<p>  <\/p>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c <a href=\"https:\/\/docs.python.org\/3\/library\/statistics\" rel=\"nofollow noopener noreferrer\"><code>statistics<\/code><\/a> \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u043e\u0439. \u041a\u0430\u043a \u0438 <code>math<\/code>, \u043e\u043d \u0437\u0430\u043c\u0435\u0442\u043d\u043e \u0440\u0430\u0437\u0432\u0438\u043b\u0441\u044f \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445. \u042d\u0442\u043e \u0435\u0449\u0435 \u043d\u0435 <code>scipy<\/code>, \u043d\u043e \u0443\u0436\u0435 \u0438 \u043d\u0435 \u0442\u043e\u0442 \u0434\u0435\u0442\u0441\u043a\u0438\u0439 \u0441\u0430\u0434, \u0447\u0442\u043e \u0431\u044b\u043b \u0432 3.4.<\/p>\n<p>  <\/p>\n<p>\u0421\u0443\u0434\u0438\u0442\u0435 \u0441\u0430\u043c\u0438:<\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/docs.python.org\/3\/library\/statistics#statistics.fmean\" rel=\"nofollow noopener noreferrer\"><code>fmean()<\/code><\/a> \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043a\u0430\u043a <code>mean()<\/code>, \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435 (3.8+);<\/li>\n<li><a href=\"https:\/\/docs.python.org\/3\/library\/statistics#statistics.geometric_mean\" rel=\"nofollow noopener noreferrer\"><code>geometric_mean()<\/code><\/a> \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u0440\u0435\u0434\u043d\u0435\u0435 (3.8+);<\/li>\n<li><a href=\"https:\/\/docs.python.org\/3\/library\/statistics#statistics.multimode\" rel=\"nofollow noopener noreferrer\"><code>multimode()<\/code><\/a> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043c\u043e\u0434\u044b (\u0441\u0430\u043c\u044b\u0435 \u0447\u0430\u0441\u0442\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u0434\u0430\u0442\u0430\u0441\u0435\u0442\u0435), \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0438\u0445 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e (\u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 <code>mode()<\/code>) (3.8+);<\/li>\n<li><a href=\"https:\/\/docs.python.org\/3\/library\/statistics#statistics.quantiles\" rel=\"nofollow noopener noreferrer\"><code>quantiles()<\/code><\/a> \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u0442 \u0434\u0430\u0442\u0430\u0441\u0435\u0442 \u043d\u0430 \u043a\u0432\u0430\u043d\u0442\u0438\u043b\u0438 (3.8+).<\/li>\n<\/ul>\n<p>  <\/p>\n<pre><code class=\"python\">import statistics  seq = list(range(1, 10))  statistics.fmean(seq) # 5.0  statistics.geometric_mean(seq) # 4.147166274396913  statistics.multimode(seq) # [1, 2, 3, 4, 5, 6, 7, 8, 9] statistics.multimode(\"python is awesome\") # ['o', ' ', 's', 'e']  statistics.quantiles(seq) # [2.5, 5.0, 7.5]<\/code><\/pre>\n<p>  <\/p>\n<p><a href=\"https:\/\/docs.python.org\/3\/library\/statistics#statistics.NormalDist\" rel=\"nofollow noopener noreferrer\"><code>NormalDist<\/code><\/a> \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0439 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u044b (3.8+):<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">from statistics import NormalDist  birth_weights = NormalDist.from_samples([2.5, 3.1, 2.1, 2.4, 2.7, 3.5]) drug_effects = NormalDist(0.4, 0.15) combined = birth_weights + drug_effects  round(combined.mean, 1) # 3.1  round(combined.stdev, 1) # 0.5<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u043a\u043e\u0440\u0440\u0435\u043b\u044f\u0446\u0438\u044f \u041f\u0438\u0440\u0441\u043e\u043d\u0430 <a href=\"https:\/\/docs.python.org\/3\/library\/statistics#statistics.correlation\" rel=\"nofollow noopener noreferrer\"><code>correlation()<\/code><\/a> \u0438 \u043a\u043e\u0432\u0430\u0440\u0438\u0430\u0446\u0438\u044f <a href=\"https:\/\/docs.python.org\/3\/library\/statistics#statistics.covariance\" rel=\"nofollow noopener noreferrer\"><code>covariance()<\/code><\/a> (3.10+):<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">import statistics  x = [1, 2, 3, 4, 5, 6, 7, 8, 9] y = [9, 8, 7, 6, 5, 4, 3, 2, 1]  statistics.correlation(x, x) # 1.0  statistics.correlation(x, y) # -1.0  statistics.covariance(x, x) # 7.5  statistics.covariance(x, y) # -7.5<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418 \u0434\u0430\u0436\u0435 \u043b\u0438\u043d\u0435\u0439\u043d\u0430\u044f \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u044f <a href=\"https:\/\/docs.python.org\/3\/library\/statistics#statistics.linear_regression\" rel=\"nofollow noopener noreferrer\"><code>linear_regression()<\/code><\/a> (3.10+):<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">import statistics  movies_by_year = {     2000: 371,     2003: 507,     2006: 608,     2009: 520,     2012: 669,     2015: 708,     2018: 873,     2021: 403, }  x = movies_by_year.keys() y = movies_by_year.values() slope, intercept = statistics.linear_regression(x, y)  year_2022 = round(slope * 2022 + intercept) # 697<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, \u043c\u043e\u0434\u0443\u043b\u044c <code>statistics<\/code> \u0441\u043b\u0430\u0432\u0438\u0442\u0441\u044f \u0435\u0449\u0435 \u0438 \u0448\u0438\u043a\u0430\u0440\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0435\u0439. \u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e.<\/p>\n<p>  <\/p>\n<p><a href=\"https:\/\/stepik.org\/lesson\/716898\/step\/8\" rel=\"nofollow noopener noreferrer\">\u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430<\/a><\/p>\n<p>  <\/p>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438: <a href=\"https:\/\/github.com\/rhettinger\" rel=\"nofollow noopener noreferrer\">Raymond Hettinger<\/a> \u2022 <a href=\"https:\/\/github.com\/stevendaprano\" rel=\"nofollow noopener noreferrer\">Steven D\u2019Aprano<\/a> \u2022 <a href=\"https:\/\/github.com\/twolodzko\" rel=\"nofollow noopener noreferrer\">Timothy Wolodzko<\/a><\/p>\n<p>  <\/p>\n<h2 id=\"zoneinfo\">zoneinfo<\/h2>\n<p>  <\/p>\n<p>\u041c\u043e\u0434\u0443\u043b\u044c <a href=\"https:\/\/docs.python.org\/3\/library\/zoneinfo\" rel=\"nofollow noopener noreferrer\"><code>zoneinfo<\/code><\/a> \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0447\u0430\u0441\u043e\u0432\u044b\u0445 \u043f\u043e\u044f\u0441\u0430\u0445 \u043f\u043e \u0432\u0441\u0435\u043c\u0443 \u043c\u0438\u0440\u0443. \u0415\u0449\u0435 \u043e\u0434\u0438\u043d \u043d\u043e\u0432\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c! (3.9+)<\/p>\n<p>  <\/p>\n<p>\u0414\u043e \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f <code>zoneinfo<\/code> \u043f\u0438\u0442\u043e\u043d \u0449\u0435\u0433\u043e\u043b\u044f\u043b \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0447\u0430\u0441\u043e\u0432\u044b\u043c \u043f\u043e\u044f\u0441\u043e\u043c <code>timezone.utc<\/code>, \u0443\u0434\u0438\u0432\u043b\u044f\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0438\u0437 \u0434\u0440\u0443\u0433\u0438\u0445 \u044f\u0437\u044b\u043a\u043e\u0432. \u0422\u0435\u043f\u0435\u0440\u044c \u044d\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u043b\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">import datetime as dt from zoneinfo import ZoneInfo  utc = dt.datetime(2022, 9, 13, hour=21, tzinfo=dt.timezone.utc) # 2022-09-13 21:00:00+00:00  paris = utc.astimezone(ZoneInfo(\"Europe\/Paris\")) # 2022-09-13 23:00:00+02:00  tokyo = utc.astimezone(ZoneInfo(\"Asia\/Tokyo\")) # 2022-09-14 06:00:00+09:00  sydney = utc.astimezone(ZoneInfo(\"Australia\/Sydney\")) # 2022-09-14 07:00:00+10:00<\/code><\/pre>\n<p>  <\/p>\n<p><a href=\"https:\/\/stepik.org\/lesson\/716898\/step\/9\" rel=\"nofollow noopener noreferrer\">\u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0430<\/a><\/p>\n<p>  <\/p>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a: <a href=\"https:\/\/github.com\/pganssle\" rel=\"nofollow noopener noreferrer\">Paul Ganssle<\/a><\/p>\n<p>  <\/p>\n<h2 id=\"itogo\">\u0418\u0442\u043e\u0433\u043e<\/h2>\n<p>  <\/p>\n<p>\u041c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u0430\u0436 17 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u043e\u0442 27 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u2014\u00a0\u0438 \u044d\u0442\u043e \u0431\u0435\u0437 \u0443\u0447\u0435\u0442\u0430 <code>asyncio<\/code>, <code>typing<\/code> \u0438 \u0432\u0435\u043b\u0438\u043a\u043e\u0433\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u043f\u0440\u043e\u0447\u0438\u0445, \u0431\u043e\u043b\u0435\u0435 \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0445. \u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0435\u0442\u0441\u044f. \u0418 \u0444\u0438\u0447\u0438, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442 \u0432\u0435\u0441\u044c\u043c\u0430 \u0440\u0430\u0437\u0443\u043c\u043d\u043e. \u0411\u0443\u0434\u0443 \u0440\u0430\u0434, \u0435\u0441\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u0438\u0437 \u043d\u043e\u0432\u0448\u0435\u0441\u0442\u0432 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u0430\u043c \u0432 \u0440\u0430\u0431\u043e\u0442\u0435!<\/p>\n<p>  <\/p>\n<p>\u0410 \u0435\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0437\u043d\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 Python \u2014 \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0439\u0442\u0435\u0441\u044c \u043d\u0430 \u043c\u043e\u0439 \u043a\u0430\u043d\u0430\u043b <a href=\"https:\/\/t.me\/ohmypy\" rel=\"nofollow noopener noreferrer\"><strong>@ohmypy<\/strong><\/a><\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/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\/post\/665020\/\"> https:\/\/habr.com\/ru\/post\/665020\/<\/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\">\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/zg\/ho\/xo\/zghoxoqg9oytk6lkfbkb68n8qf0.png\" alt=\"Python 3.8+\" data-src=\"https:\/\/habrastorage.org\/webt\/zg\/ho\/xo\/zghoxoqg9oytk6lkfbkb68n8qf0.png\"\/><\/p>\n<p>  <\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f Python, \u0432\u0441\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0434\u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u043c \u0444\u0438\u0447\u0430\u043c \u044f\u0437\u044b\u043a\u0430: \u043c\u043e\u0440\u0436\u043e\u0432\u043e\u043c\u0443 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0443, \u0441\u043b\u0438\u044f\u043d\u0438\u044e \u0441\u043b\u043e\u0432\u0430\u0440\u0435\u0439, \u043f\u0430\u0442\u0442\u0435\u0440\u043d-\u043c\u0430\u0442\u0447\u0438\u043d\u0433\u0443. \u0415\u0449\u0435 \u043c\u043d\u043e\u0433\u043e \u043f\u0438\u0448\u0443\u0442 \u043e\u0431 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u0445 \u0432 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0435 (\u043c\u043e\u0434\u0443\u043b\u044c <code>asyncio<\/code>) \u0438 \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u0438 (\u043c\u043e\u0434\u0443\u043b\u044c <code>typing<\/code>) \u2014 \u044d\u0442\u0438 \u043c\u043e\u0434\u0443\u043b\u0438 \u043d\u0430 \u0432\u0438\u0434\u0443 \u0438 \u0431\u0443\u0440\u043d\u043e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u044e\u0442\u0441\u044f.<\/p>\n<p>  <\/p>\n<p>\u041e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c \u043c\u043e\u0434\u0443\u043b\u044f\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0434\u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043d\u0435\u0437\u0430\u0441\u043b\u0443\u0436\u0435\u043d\u043d\u043e \u043c\u0430\u043b\u043e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f. \u0425\u043e\u0447\u0443 \u044d\u0442\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0433\u043e \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u0432 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 3.8\u20133.10.<\/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-333010","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/333010","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=333010"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/333010\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=333010"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=333010"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=333010"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}