← Back to team overview

divmod-dev team mailing list archive

[Bug 901235] Re: Warns after using a variable that was deleted in a conditional

 

*** This bug is a duplicate of bug 885140 ***
    https://bugs.launchpad.net/bugs/885140

** This bug has been marked a duplicate of bug 885140
   using del in if clause confuses pyflakes

-- 
You received this bug notification because you are a member of Divmod-
dev, which is the registrant for Pyflakes.
https://bugs.launchpad.net/bugs/901235

Title:
  Warns after using a variable that was deleted in a conditional

Status in Pyflakes:
  New

Bug description:
  Consider this snippet:

      def f():
          x = 1
          if False:
              del x
          x

  It is entirely appropriate to use 'x' after that conditional, but
  pyflakes warns with "undefined name 'x'". Instead it should not warn
  at all.

  See http://bazaar.launchpad.net/~testtools-
  committers/testtools/trunk/view/head:/testtools/matchers.py#L789 for a
  real world example.

To manage notifications about this bug go to:
https://bugs.launchpad.net/pyflakes/+bug/901235/+subscriptions


References