抱歉,您的浏览器无法访问本站
本页面需要浏览器支持(启用)JavaScript
了解详情 >

There’re many articles about how to build a python lib, but fewer articles discuss about how to build a command line app using python. This article is to solve the problem.

【Code】初探Python类型标注

干点轻松的事情,看了一下Python官方文档里面关于类型标注的知识,怎么说,Python官方对于类型检查这个问题的认识,远远比那些Python吹成熟多了(好像说了一句废话,其实想表达的是按照现在Python的发展程度,过于灵活的类型系统早就成了发展的桎梏,官方的态度也表明了这一点,只是还有很多人没有意识到,还沉浸在不用写类型的快感中而已)。作为一个Python黑,对于Python建立健全的类型检查机制这件事上,我是举双手双脚赞成的。

ping on un-painting: // https://drafts.csswg.org/css-sizing-4/#intrinsic-size-override if (!old || rectNotEQ(old, rect)) { spaced.set(el, rect); el.style["contain-intrinsic-size"] = `${rect.width}px ${rect.height}px`; } }; let iObs = new IntersectionObserver( (entries, o) => { entries.forEach((entry) => { // We don't care if the element is intersecting or // has been laid out as our page structure ensures // they'll get the right width. reserveSpace(entry.target, entry.boundingClientRect); }); }, { rootMargin: "500px 0px 500px 0px" } ); let rObs = new ResizeObserver((entries, o) => { entries.forEach((entry) => { reserveSpace(entry.target, entry.contentRect); }); }); let resizeResilientDeferredRendering = (Selector) => { let articles = document.querySelectorAll(Selector); if (articles.length) { articles.forEach((el) => { iObs.observe(el); rObs.observe(el); }); // Workaround for Chrome bug, part 2. // // Re-enable browser management of rendering for the // first article after the first paint. Double-rAF // to ensure we get called after a layout. requestAnimationFrame(() => { requestAnimationFrame(() => { articles[0].style["content-visibility"] = "auto"; }); }); } }; let contentVisibilityScrollFix = () => { if (!("content-visibility" in document.documentElement.style)) { return; } resizeResilientDeferredRendering(".post-story"); }; contentVisibilityScrollFix(); volantis.pjax.push(contentVisibilityScrollFix); } catch (error) { console.log(error); }