首页

/

友链

/

分享

/

内推

/

关于


Python零碎知识汇总

这些都是我在文档里阅读到或者是在网上看到的,不足以成文却值得注意的知识.

If a name is bound anywhere within a code block, all uses of the name within the block are treated as references to the current block. (Note: This can lead to errors when a name is used within a block before it is bound.)

.. code:: python

>>> round(10.12345, 2)
10.12

坑就坑在它接住的异常不是 AttributeError 而是 Exception