{"id":254783,"date":"2015-04-08T14:25:20","date_gmt":"2015-04-08T10:25:20","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=254783"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=254783","title":{"rendered":"Frame object \u0432 Python. \u0427\u0442\u043e \u0441 \u043d\u0438\u043c \u043c\u043e\u0436\u043d\u043e, \u0430 \u0447\u0442\u043e \u043d\u0435\u043b\u044c\u0437\u044f (\u0432 production \u0438 \u0434\u0440\u0443\u0433\u043e\u043c \u043f\u0440\u0438\u043b\u0438\u0447\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435) \u0434\u0435\u043b\u0430\u0442\u044c"},"content":{"rendered":"<p> \t\t\t\u041e Python \u043d\u0430 \u0425\u0430\u0431\u0440\u0435 \u0431\u044b\u043b\u043e \u043c\u043d\u043e\u0433\u043e \u0445\u043e\u0440\u043e\u0448\u0438\u0445 \u0441\u0442\u0430\u0442\u0435\u0439. \u041a\u0430\u043a \u043e\u0431 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044f\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0442\u0430\u043a \u0438 \u043e \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u044b\u0445 \u0444\u0438\u0447\u0430\u0445, \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u0435\u0439\u043d\u0441\u0442\u0440\u0438\u043c\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u0430\u0445. \u041e\u0434\u043d\u0430\u043a\u043e \u044f \u0441 \u0443\u0434\u0438\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b (\u043f\u043e\u043f\u0440\u0430\u0432\u044c\u0442\u0435, \u0435\u0441\u043b\u0438 \u043d\u0435 \u043f\u0440\u0430\u0432), \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u043e\u0434\u043d\u0430 \u0432\u0430\u0436\u043d\u0430\u044f \u0442\u0435\u043c\u0430, \u043d\u0435 \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u0430\u044f \u043d\u0438 \u043d\u0430 \u0425\u0430\u0431\u0440\u0435, \u043d\u0438 \u0432 \u0440\u0443\u0441\u0441\u043a\u043e\u044f\u0437\u044b\u0447\u043d\u043e\u043c \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435 \u0432\u043e\u043e\u0431\u0449\u0435. \u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u0430 \u0442\u0430\u043a\u043e\u0439 \u0448\u0442\u0443\u043a\u0435, \u043a\u0430\u043a stack frame. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u043e\u043d\u0430 \u043d\u0435 \u0441\u043a\u0430\u0436\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e, \u043d\u0443 \u0438\u043b\u0438 \u043c\u043e\u0436\u0435\u0442 \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u043f\u0443\u043d\u043a\u0442\u0430 \u043f\u043e\u0447\u0442\u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u043e\u043f\u044b\u0442\u043d\u044b\u043c python-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c, \u043e\u0434\u043d\u0430\u043a\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u0430 \u043d\u043e\u0432\u0438\u0447\u043a\u0430\u043c (\u0430 \u043c\u043e\u0436\u0435\u0442 \u0438 \u0432\u0440\u0435\u0434\u043d\u0430, \u043d\u043e \u0432\u0441\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043d\u0438\u0436\u0435).<\/p>\n<p>  \u042f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044e \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0435\u0451 \u0431\u044b\u043b\u043e \u0443\u0434\u043e\u0431\u043d\u043e \u0447\u0438\u0442\u0430\u0442\u044c, \u043e\u0442\u043a\u0440\u044b\u0432 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e repl \u0438 <s>\u0431\u0435\u0437\u0434\u0443\u043c\u043d\u043e \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0443\u0434\u0430 \u043a\u043e\u0434<\/s> \u044d\u043a\u0441\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0438\u043c\u0435\u0435\u0442 \u0432\u0438\u0434 \u00ab\u043e\u0434\u043d\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u0438\u043a\u0438 \u0432 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0435\u00bb. <\/p>\n<p>  \u041d\u0430\u0447\u043d\u0435\u043c \u043c\u044b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u0437\u0434\u0430\u043b\u0435\u043a\u0430, \u0441 \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e Traceback \u044d\u0442\u043e \u0442\u043e\u0436\u0435 \u043e\u0431\u044a\u0435\u043a\u0442, \u0430 \u043f\u043e\u0442\u043e\u043c \u043d\u0430\u0439\u0434\u0435\u043c \u0433\u0434\u0435 \u0442\u0430\u043c \u0441\u0442\u0435\u043a\u043e\u0432\u044b\u0439 \u043a\u0430\u0434\u0440 \u0438 \u0443\u0436\u0435 \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0434\u0435\u043b\u0443.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<pre><code class=\"python\">&gt;&gt;&gt; import requests &gt;&gt;&gt; requests.get(42) Traceback (most recent call last):   File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;   File &quot;\/usr\/lib\/python3\/dist-packages\/requests\/api.py&quot;, line 55, in get     return request('get', url, **kwargs)   File &quot;\/usr\/lib\/python3\/dist-packages\/requests\/api.py&quot;, line 44, in request     return session.request(method=method, url=url, **kwargs)   File &quot;\/usr\/lib\/python3\/dist-packages\/requests\/sessions.py&quot;, line 421, in request     prep = self.prepare_request(req)   File &quot;\/usr\/lib\/python3\/dist-packages\/requests\/sessions.py&quot;, line 359, in prepare_request     hooks=merge_hooks(request.hooks, self.hooks),   File &quot;\/usr\/lib\/python3\/dist-packages\/requests\/models.py&quot;, line 287, in prepare     self.prepare_url(url, params)   File &quot;\/usr\/lib\/python3\/dist-packages\/requests\/models.py&quot;, line 338, in prepare_url     &quot;Perhaps you meant http:\/\/{0}?&quot;.format(url)) requests.exceptions.MissingSchema: Invalid URL '42': No schema supplied. Perhaps you meant http:\/\/42? <\/code><\/pre>\n<p>  \u0412\u044b\u0448\u0435 \u043c\u044b \u0432\u0438\u0434\u0438\u043c Traceback, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0446\u0435\u043f\u043e\u0447\u043a\u0443 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439. <\/p>\n<pre><code class=\"python\">&gt;&gt;&gt; import sys &gt;&gt;&gt; sys.last_traceback &lt;traceback object at 0x7f8c37378608&gt; <\/code><\/pre>\n<pre><code class=\"python\">&gt;&gt;&gt; dir(sys.last_traceback) ['tb_frame', 'tb_lasti', 'tb_lineno', 'tb_next'] <\/code><\/pre>\n<p>  \u0418\u0442\u0430\u043a, \u0432\u044b\u0448\u0435 \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u043e\u0431\u044a\u0435\u043a\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u043d\u0435\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u043e\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435. \u0415\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0434\u0435\u0431\u0430\u0433\u0435\u0440\u0430, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0447\u0442\u043e \u0436\u0435 \u0441\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c. \u041c\u043e\u0436\u043d\u043e \u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u0435\u043c Traceback. \u041d\u0430 \u044d\u0442\u043e\u043c \u043d\u0435 \u0431\u0443\u0434\u0443 \u043e\u0441\u043e\u0431\u043e \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f, \u044d\u0442\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0435 \u043f\u043e \u0442\u0435\u043c\u0435 \u0441\u0442\u0430\u0442\u044c\u0438.<\/p>\n<p>  \u041d\u0430\u0441 \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u0442\u044c \u0430\u0442\u0442\u0440\u0438\u0431\u0443\u0442 tb_frame. \u042d\u0442\u043e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438 \u0435\u0441\u0442\u044c stack frame (\u0421\u0442\u0435\u043a\u043e\u0432\u044b\u0439 \u043a\u0430\u0434\u0440). \u0421\u0443\u0442\u044c \u0435\u0433\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u043e \u043d\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u0433\u043e \u0432 \u0421. \u041f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0435\u0451 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0442 \u0432 \u0441\u0442\u0435\u043a, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0443\u0436\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0435\u0451 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435.<\/p>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043e\u0442\u043b\u0438\u0447\u0438\u044f \u043e\u0442 C.<\/p>\n<p>  \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u0432 \u0441\u0438\u043b\u0443 \u0442\u043e\u0433\u043e \u0447\u0442\u043e Python \u044f\u0437\u044b\u043a \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0439, \u0441\u0442\u0435\u043a\u043e\u0432\u044b\u0439 \u043a\u0430\u0434\u0440 \u0432 \u043d\u0435\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u044f\u0432\u043d\u043e\u043c \u0432\u0438\u0434\u0435, \u0430 \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u0432 \u0441\u0438\u043b\u0443 \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e-\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439, \u043e\u043d \u0435\u0449\u0435 \u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c.<\/p>\n<p>  \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u044d\u0442\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0438\u043d\u0442\u0440\u043e\u0441\u043f\u0435\u043a\u0446\u0438\u0438 \u0432 Python \u2014 \u043c\u043e\u0434\u0443\u043b\u044c inspect \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0431\u0435\u0440\u0442\u043a\u043e\u0439 \u043d\u0430\u0434 \u043d\u0438\u043c. (\u0430 \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u043d\u0430\u0434 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u0438\u0437 sys).<\/p>\n<p>  \u0414\u0435\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0432\u0441\u0435\u0445 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u043c\u0435\u0441\u0442\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f.<\/p>\n<h4>0) \u041a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 stack frame<\/h4>\n<p>  \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u044c \u0438\u0437 traceback&#8217;a. \u041d\u043e \u043a \u0441\u0447\u0430\u0441\u0442\u044c\u044e \u0435\u0441\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u0438\u043c \u0447\u0435\u043c \u0431\u0440\u043e\u0441\u0430\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438 \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c traceback\/<\/p>\n<pre><code class=\"python\">&gt;&gt;&gt; sys._getframe() &lt;frame object at 0x7fda9bffa388&gt; <\/code><\/pre>\n<p>  \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0438\u0437 \u0441\u0442\u0435\u043a\u0430 \u0432\u044b\u0437\u043e\u0432\u043e\u0432. \u041c\u043e\u0436\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0435\u043c\u0443 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0433\u043b\u0443\u0431\u0438\u043d\u0443, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0432 \u0441\u0442\u0435\u043a\u0435 \u043f\u043e\u0432\u044b\u0448\u0435. \u0412\u043f\u0440\u043e\u0447\u0435\u043c, \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442 f_back.<\/p>\n<p>  \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0435\u0441\u043b\u0438 \u043c\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0438 repl \u0442\u043e \u043c\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u043c\u0441\u044f \u043d\u0430 \u0432\u0435\u0440\u0448\u0438\u043d\u0435 \u0441\u0442\u0435\u043a\u0430, \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 sys._getframe().f_back \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 None, \u0430 sys._getframe(1) \u0442\u0430\u043a\u0438 \u0432\u043e\u0432\u0441\u0435 \u043a\u0438\u0434\u0430\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435.<\/p>\n<pre><code class=\"python\">&gt;&gt;&gt; sys._getframe().f_back &gt;&gt;&gt; sys._getframe(1) Traceback (most recent call last):   File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt; ValueError: call stack is not deep enough <\/code><\/pre>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e \u043b\u044f\u043c\u0431\u0434\u0430-\u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0442 \u0440\u0435\u0448\u0438\u0442\u044c \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443:<\/p>\n<pre><code class=\"python\">&gt;&gt;&gt; (lambda: sys._getframe().f_back == sys._getframe(1))() True \u0418 \u0434\u0430\u0436\u0435 (\u0445\u043e\u0442\u044f \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e) &gt;&gt;&gt; (lambda: sys._getframe().f_back is sys._getframe(1))() True <\/code><\/pre>\n<p>  \u0415\u0449\u0435 \u0435\u0441\u0442\u044c sys._current_frames(), \u043d\u043e \u043e\u043d\u0430 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438. \u0414\u0430\u043b\u044c\u0448\u0435 \u043e\u043d\u0430 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442, \u043d\u043e \u0434\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0442\u044b \u043a\u0430\u0440\u0442\u0438\u043d\u044b:<\/p>\n<pre><code class=\"python\">&gt;&gt;&gt; import threading &gt;&gt;&gt; sys._current_frames() {140576946280256: &lt;frame object at 0x7fda9bffa6c8&gt;} &gt;&gt;&gt; threading.Thread(target=lambda: print(sys._current_frames())).start() {140576883275520: &lt;frame object at 0x7fda9b337048&gt;, 140576946280256: &lt;frame object at 0x228fbc8&gt;} <\/code><\/pre>\n<p>  \u041d\u0443, \u0438 \u0442\u0443\u0442 \u0441\u0430\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u043e\u0446\u0438\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043a \u044d\u0442\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c:  <\/p>\n<blockquote><p>CPython implementation detail: This function should be used for internal and specialized purposes only. It is not guaranteed to exist in all implementations of Python.<\/p><\/blockquote>\n<p>  \u0422\u0430\u043a \u0447\u0442\u043e \u0435\u0434\u0432\u0430 \u043b\u0438 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u043a\u043e\u0440\u044b\u0441\u0442\u043d\u044b\u0445 \u0446\u0435\u043b\u0435\u0439 \u0442\u0435\u043c \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0438\u0436\u0435.<\/p>\n<h4>1) \u041a\u0430\u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043a\u0442\u043e \u0432\u044b\u0437\u0432\u0430\u043b \u0444\u0443\u043d\u043a\u0446\u0438\u044e<\/h4>\n<p>  \u041f\u043e\u0434\u043e\u0431\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u043b\u0435\u0433\u043a\u043e \u043c\u043e\u0436\u0435\u0442 \u0432\u0441\u043f\u043b\u044b\u0442\u044c \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0434\u0435\u0431\u0430\u0433\u0430, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043a\u043e\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043c\u043d\u043e\u0433\u043e \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445 \u0438 \u0437\u0430\u043f\u0443\u0442\u0430\u043d\u043d\u044b\u0445 \u0444\u0440\u0435\u0439\u043c\u0444\u043e\u0440\u043a\u043e\u0432. \u0412\u043f\u0440\u043e\u0447\u0435\u043c \u0430\u0434\u0435\u043f\u0442\u044b \u0447\u0435\u0440\u043d\u043e\u0439 \u043c\u0430\u0433\u0438\u0438 \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0442\u0440\u044e\u043a \u0438 \u0435\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u043a\u0443\u0434\u0430 \u043c\u0435\u043d\u0435\u0435 \u0431\u0435\u0437\u043e\u0431\u0438\u0434\u043d\u044b\u0445 \u0432\u0435\u0449\u0435\u0439.<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0448\u043b\u043e\u0433\u043e \u043f\u043e\u0434\u043f\u0443\u043d\u043a\u0442\u0430 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0432 \u0446\u0435\u043b\u043e\u043c \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u043a\u0430\u043a \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c. \u0412 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0444\u0440\u0435\u0439\u043c, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u044b\u043b \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e: sys._getframe(1). \u041e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0432\u043e\u043f\u0440\u043e\u0441, \u043a\u0430\u043a \u0438\u0437\u0432\u043b\u0435\u0447\u044c \u0438\u0437 \u0444\u0440\u0435\u0439\u043c\u0430 \u043d\u0443\u0436\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e.<\/p>\n<p>  \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"python\">&gt;&gt;&gt; threading.Thread(target=lambda: print(sys._getframe(1).f_code.co_name)).run() run <\/code><\/pre>\n<p>  \u041e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0435 Code object \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u0437\u0430 \u0440\u0430\u043c\u043a\u0438 \u0441\u0442\u0430\u0442\u044c\u0438, \u043c\u043e\u0436\u0435\u0442 \u043a\u0430\u043a-\u043d\u0438\u0431\u0443\u0434\u044c \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 \u0440\u0430\u0437. \u041d\u043e \u0443 frame object \u0435\u0441\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442 f_code, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0437 \u0441\u0435\u0431\u044f code object, \u0441\u0440\u0435\u0434\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438\u043c\u044f \u043c\u0435\u0442\u043e\u0434\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0432\u0443\u044e\u0449\u0435\u0433\u043e code object.<\/p>\n<p>  \u041a\u0441\u0442\u0430\u0442\u0438, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 inspect \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0444\u0430\u043a\u0442\u0438\u0447\u0441\u043a\u0438 \u0442\u043e\u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u043d\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u0438\u043c\u043f\u0430\u0442\u0438\u0447\u043d\u0435\u0435.<\/p>\n<pre><code class=\"python\">&gt;&gt;&gt; threading.Thread(target=lambda: print(inspect.stack()[1][3])).run() run <\/code><\/pre>\n<p>  \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0437\u043b\u043e\u0443\u043f\u043e\u0442\u0440\u0435\u0431\u0438\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c \u043d\u0430\u0439\u0434\u0435\u0442 \u0441\u0430\u043c.<br \/>  \u0415\u0449\u0435 \u043e\u0434\u0438\u043d \u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u0434\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u044e\u0449\u0438\u0439 \u043a \u0442\u0430\u043a\u0438\u043c \u0438\u0434\u0435\u044f\u043c:<\/p>\n<pre><code class=\"python\">&gt;&gt;&gt; threading.Thread(target=lambda: print('called from', sys._getframe(1).f_globals['__name__'])).run() called from threading <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c, \u043f\u043e\u043b\u0443\u0447\u0438\u0432 \u0438\u043c\u044f \u043c\u043e\u0434\u0443\u043b\u044f, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043c\u043e\u0434\u0443\u043b\u044c \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u0438\u043c\u0435\u043d\u0438, \u0430 \u043f\u043e\u0442\u043e\u043c \u0432\u0437\u044f\u0442\u044c \u043e\u0442\u0442\u0443\u0434\u0430 \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c. \u0418 \u043d\u0438\u043a\u0430\u043a\u0430\u044f \u0418\u0435\u0440\u0430\u0440\u0445\u0438\u044f \u041a\u043b\u0430\u0441\u0441\u043e\u0432 \u043d\u0435 \u0441\u043f\u0430\u0441\u0435\u0442 \u043e\u0442 \u0442\u0430\u043a\u043e\u0433\u043e \u043a\u043e\u0449\u0443\u043d\u0441\u0442\u0432\u0430 (\u0445\u043e\u0442\u044f \u0445\u043e\u0440\u043e\u0448\u0430\u044f \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e \u0441\u043f\u0430\u0441\u0435\u0442 \u043e\u0442 \u0436\u0435\u043b\u0430\u043d\u0438\u044f \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435 \u0434\u0435\u043b\u0430\u0442\u044c)<\/p>\n<h4>2) \u0418\u0437\u043c\u0435\u043d\u044f\u0435\u043c locals \u0443 \u0444\u0440\u0435\u0439\u043c\u0430<\/h4>\n<p>  \u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0432 \u044d\u0442\u043e\u043c \u043f\u043e\u0434\u043f\u0443\u043d\u0442\u043a\u0435 \u043d\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043d\u043e\u0432\u0430 \u0438 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430 \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u043c \u043f\u0438\u0442\u043e\u043d\u0438\u0441\u0442\u0430\u043c, \u043d\u043e \u0442\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435.<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u043f\u0443\u043d\u043a\u0442\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043e\u0442\u043e\u0439\u0442\u0438 \u043e\u0442 \u043e\u0434\u043d\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440.<\/p>\n<p>  \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"python\">import sys  class Example(object):      def __init__(self):         pass      def check_noosphere_connection():         print('OK')           def proof(example):      a = 2     b = 2     example.check_noosphere_connection()          print('2 + 2 = {}'.format(str(a + b)))  def broken_evil_force():     def corrupted_noosphere(pseudo_self):         print('OK')         frame = sys._getframe().f_back         frame.f_back.f_locals['a'] = 3     FakeExample = type('FakeExample', (), {'check_noosphere_connection': corrupted_noosphere})      proof(FakeExample()) <\/code><\/pre>\n<pre><code class=\"python\">% python habr_example.py  OK 2 + 2 = 4 <\/code><\/pre>\n<p>  \u0423\u0432\u044b, \u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c locals \u043d\u0435\u043b\u044c\u0437\u044f. \u0422\u043e\u0447\u043d\u0435\u0435, \u043c\u043e\u0436\u043d\u043e, \u043d\u043e \u044d\u0442\u043e\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e \u043d\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f.<\/p>\n<p>  \u0412\u043e\u0442 \u0434\u0432\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u044d\u0442\u0443 \u0442\u0435\u043c\u0443, \u0432 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043d\u0438\u0445 \u0430\u0432\u0442\u043e\u0440 \u0434\u043e\u0441\u0442\u0438\u0433\u0443\u0435\u0442 \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0435\u0439 \u0431\u0430\u0439\u0442\u043a\u043e\u0434\u0430, \u0430 \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 \u043c\u0435\u043d\u044f\u0435\u0442 \u0441\u0430\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442.<\/p>\n<p>  <a href=\"http:\/\/code.activestate.com\/recipes\/577283-decorator-to-expose-local-variables-of-a-function-\">code.activestate.com\/recipes\/577283-decorator-to-expose-local-variables-of-a-function-<\/a><br \/>  <a href=\"http:\/\/stackoverflow.com\/a\/4257352\">stackoverflow.com\/a\/4257352<\/a><\/p>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e \u0441\u043f\u043e\u0441\u043e\u0431 \u0435\u0441\u0442\u044c! <a href=\"http:\/\/pydev.blogspot.ru\/2014\/02\/changing-locals-of-frame-frameflocals.html\">pydev.blogspot.ru\/2014\/02\/changing-locals-of-frame-frameflocals.html<\/a><\/p>\n<p>  \u0412\u044b\u0437\u043e\u0432 <i>\u0441ctypes.pythonapi.PyFrame_LocalsToFast(ctypes.py_object(frame), ctypes.c_int(0))<\/i> \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 locals.<\/p>\n<pre><code class=\"python\">import sys import ctypes  class Example(object):      def __init__(self):         pass      def check_noosphere_connection():         print('OK')           def proof(example):      a = 2     b = 2     example.check_noosphere_connection()     print('2 + 2 = {}'.format(str(a + b)))  def broken_evil_force():     def corrupted_noosphere(pseudo_self):         print('OK')         frame = sys._getframe().f_back         frame.f_back.f_locals['a'] = 3     FakeExample = type('FakeExample', (), {'check_noosphere_connection': corrupted_noosphere})      proof(FakeExample())  def evil_force():     def corrupted_noosphere(pseudo_self):         print('OK')         frame = sys._getframe()         frame.f_back.f_locals['a'] = 3         ctypes.pythonapi.PyFrame_LocalsToFast(ctypes.py_object(frame.f_back), ctypes.c_int(0))     FakeExample = type('FakeExample', (), {'check_noosphere_connection': corrupted_noosphere})      proof(FakeExample())   if __name__ == '__main__':      broken_evil_force()     evil_force() <\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c:<\/p>\n<pre><code class=\"python\">% python habr_example.py OK 2 + 2 = 4 OK 2 + 2 = 5 <\/code><\/pre>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c, \u043f\u043e\u0436\u0430\u043b\u0443\u0439, \u0432\u0441\u0451. \u0420\u0430\u0437\u0432\u0435 \u0447\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044e: \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 traceback \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0445\u043e\u0434\u0438\u0442\u044c \u043f\u043e \u0444\u0440\u0435\u0439\u043c\u0443 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0432\u0435\u0440\u0445, \u043d\u043e \u0438 \u0432\u043d\u0438\u0437, \u0445\u043e\u0442\u044f \u044d\u0442\u043e \u0443\u0436\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b\u0442\u044c \u043f\u043e\u043d\u044f\u0442\u043d\u043e.<\/p>\n<p>  \u0411\u0443\u0434\u0443 \u0440\u0430\u0434 \u0443\u0441\u043b\u044b\u0448\u0430\u0442\u044c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0438 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u044f, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0440\u0435\u0439\u043c\u043e\u0432.<\/p>\n<h4>\u041f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 (\u0447\u0430\u0441\u0442\u044c \u0431\u044b\u043b\u0430 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435)<\/h4>\n<p>  1) <a href=\"https:\/\/docs.python.org\/3.4\/library\/sys.html\">docs.python.org\/3.4\/library\/sys.html<\/a><br \/>  2) <a href=\"https:\/\/docs.python.org\/3\/library\/inspect.html\">docs.python.org\/3\/library\/inspect.html<\/a><br \/>  3) <a href=\"http:\/\/code.activestate.com\/recipes\/577283-decorator-to-expose-local-variables-of-a-function-\">code.activestate.com\/recipes\/577283-decorator-to-expose-local-variables-of-a-function-<\/a><br \/>  4) <a href=\"http:\/\/stackoverflow.com\/questions\/4214936\/how-can-i-get-the-values-of-the-locals-of-a-function-after-it-has-been-executed\/4257352#4257352\">stackoverflow.com\/questions\/4214936\/how-can-i-get-the-values-of-the-locals-of-a-function-after-it-has-been-executed\/4257352#4257352<\/a><br \/>  5) <a href=\"http:\/\/pydev.blogspot.ru\/2014\/02\/changing-locals-of-frame-frameflocals.html\">pydev.blogspot.ru\/2014\/02\/changing-locals-of-frame-frameflocals.html<\/a> \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/255239\/\"> http:\/\/habrahabr.ru\/post\/255239\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p> \t\t\t\u041e Python \u043d\u0430 \u0425\u0430\u0431\u0440\u0435 \u0431\u044b\u043b\u043e \u043c\u043d\u043e\u0433\u043e \u0445\u043e\u0440\u043e\u0448\u0438\u0445 \u0441\u0442\u0430\u0442\u0435\u0439. \u041a\u0430\u043a \u043e\u0431 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044f\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0442\u0430\u043a \u0438 \u043e \u043f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u044b\u0445 \u0444\u0438\u0447\u0430\u0445, \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u0435\u0439\u043d\u0441\u0442\u0440\u0438\u043c\u043d\u044b\u0445 \u044f\u0437\u044b\u043a\u0430\u0445. \u041e\u0434\u043d\u0430\u043a\u043e \u044f \u0441 \u0443\u0434\u0438\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b (\u043f\u043e\u043f\u0440\u0430\u0432\u044c\u0442\u0435, \u0435\u0441\u043b\u0438 \u043d\u0435 \u043f\u0440\u0430\u0432), \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u043e\u0434\u043d\u0430 \u0432\u0430\u0436\u043d\u0430\u044f \u0442\u0435\u043c\u0430, \u043d\u0435 \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u0430\u044f \u043d\u0438 \u043d\u0430 \u0425\u0430\u0431\u0440\u0435, \u043d\u0438 \u0432 \u0440\u0443\u0441\u0441\u043a\u043e\u044f\u0437\u044b\u0447\u043d\u043e\u043c \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435 \u0432\u043e\u043e\u0431\u0449\u0435. \u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u0430 \u0442\u0430\u043a\u043e\u0439 \u0448\u0442\u0443\u043a\u0435, \u043a\u0430\u043a stack frame. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u043e\u043d\u0430 \u043d\u0435 \u0441\u043a\u0430\u0436\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e, \u043d\u0443 \u0438\u043b\u0438 \u043c\u043e\u0436\u0435\u0442 \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u043f\u0443\u043d\u043a\u0442\u0430 \u043f\u043e\u0447\u0442\u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u043e\u043f\u044b\u0442\u043d\u044b\u043c python-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c, \u043e\u0434\u043d\u0430\u043a\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u0430 \u043d\u043e\u0432\u0438\u0447\u043a\u0430\u043c (\u0430 \u043c\u043e\u0436\u0435\u0442 \u0438 \u0432\u0440\u0435\u0434\u043d\u0430, \u043d\u043e \u0432\u0441\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043d\u0438\u0436\u0435).<\/p>\n<p>  \u042f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044e \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0435\u0451 \u0431\u044b\u043b\u043e \u0443\u0434\u043e\u0431\u043d\u043e \u0447\u0438\u0442\u0430\u0442\u044c, \u043e\u0442\u043a\u0440\u044b\u0432 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e repl \u0438 <s>\u0431\u0435\u0437\u0434\u0443\u043c\u043d\u043e \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0443\u0434\u0430 \u043a\u043e\u0434<\/s> \u044d\u043a\u0441\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0438\u043c\u0435\u0435\u0442 \u0432\u0438\u0434 \u00ab\u043e\u0434\u043d\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u0438\u043a\u0438 \u0432 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0435\u00bb. <\/p>\n<p>  \u041d\u0430\u0447\u043d\u0435\u043c \u043c\u044b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u0437\u0434\u0430\u043b\u0435\u043a\u0430, \u0441 \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e Traceback \u044d\u0442\u043e \u0442\u043e\u0436\u0435 \u043e\u0431\u044a\u0435\u043a\u0442, \u0430 \u043f\u043e\u0442\u043e\u043c \u043d\u0430\u0439\u0434\u0435\u043c \u0433\u0434\u0435 \u0442\u0430\u043c \u0441\u0442\u0435\u043a\u043e\u0432\u044b\u0439 \u043a\u0430\u0434\u0440 \u0438 \u0443\u0436\u0435 \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0434\u0435\u043b\u0443.  <\/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-254783","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/254783","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=254783"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/254783\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=254783"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=254783"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=254783"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}