• 转到主导航栏
  • 转到内容
  • 转到底部
listcomp Pro listcomp Pro 温故而知新
  • Posts
  • Categories
  • Tags
  • About

    Python: for-else with break

    September 28, 2017 少于 1 分钟阅读

    Python Tips: 19. For - Else:

    The else clause executes when the loop completes normally. This means that the loop did not encounter any break.

    In addition, if an exception is raised in for without handling, else after this for won’t execute.

    分类: Python

    更新时间: September 28, 2017

    分享

    X Facebook LinkedIn Bluesky
    上一页 下一页

    留下评论

    猜您还喜欢

    Python: Function Signatures in Decorator Design

    August 28, 2025 1 分钟阅读

    其实在 Fluent Python: Chapter 7 - Function Decorators and Closures 有讲,但没有专注在 signature 上。

    What Can a Parser Return? Six Output Forms, LL vs LR

    August 25, 2025 3 分钟阅读

    Output Type 1: Boolean (i.e. acceptance only)

    Python Language Services: ast module (vs deprecated parser module for parse trees)

    August 25, 2025 2 分钟阅读

    Parse Trees vs ASTs

    Python Language Services: tokenize module

    August 22, 2025 1 分钟阅读

    tokenize module

    • 关注:
    • GitHub
    • Feed
    © 2025 listcomp Pro. 技术来自于 Jekyll & Minimal Mistakes.