Skip to content

Calling LBYL an anti-pattern is not exactly correct #125

@tucked

Description

@tucked

https://mail.python.org/pipermail/python-dev/2014-March/133118.html

I disagree with the position that EAFP is better than
LBYL, or "generally recommended" by Python. (Where do you get that? From
the same sources that are so obsessed with DRY they'd rather introduce a
higher-order-function than repeat one line of code? :-)

IMO, the primary motivation for EAFP over LBYL is avaoiding TOCTOU bugs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions