TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

How py.path ate my files

2 点作者 thepain大约 9 年前

1 comment

thepain大约 9 年前
Update: there is an error in the write-up:<p><pre><code> print p </code></pre> actually returns the path string. However since I was using IPython, showing `p` without printing it displays the object representation:<p><pre><code> In [20]: p Out[20]: local(&#x27;&#x2F;home&#x2F;user&#x27;) </code></pre> This story is nothing I am proud of, but I wanted to share it anyway, I think there are a few interesting facets to this, e.g. how I got there:<p>- not discovering the solution through the documentation,<p>- hacking away instead of asking,<p>- lack of attention to detail when hacking through it (do I really wanna do this on my homefolder???),<p>- also: forgetting about the incident right away<p>I guess that makes me look bad, but I believe such errors happen everywhere and all the time. So there is the question, why did the solution not occur to me? Am I really just stupid and I am the only one? Or should the `__str__` method be included in API-documentation?<p>I don&#x27;t know, but I&#x27;d like to hear your thoughts!<p>(edit: formatting)