After creating a TAGS file for my project (`find . -name "*.py" | xargs etags`) I can use `M-.` to jump to the definition of a function. That's great. But if I want the definition of a global constant -- say, `x = 3` -- Emacs does not know where to find it.

Is there any way to explain to Emacs where constants, not just functions, are defined? I don't need this for anything defined within a function (or a for-loop or whatnot), just global ones.

More detail
===========

Previous incarnations of this question used "top-level" instead of "global", but with @Thomas's help I realized that's imprecise. What I meant by a global definition is anything a module defines. Thus in

```
import m

if m.foo:
  def f():
    x = 3
    return x
  y, z = 1, 2
else:
  def f():
    x = 4
    return x
  y, z = 2, 3
del(z)

```

the things defined by the module are `f` and `y`, despite the sites of those definitions being indented to the right. `x` is a local variable, and `z`'s definition is deleted before the end of the module.

I *believe* that a sufficient rule to capture all global assignments would be to simply ignore them inside `def` expressions (noting that the `def` keyword itself might be indented at any level) and otherwise parse for any symbol to the left of `=` (noting that there might be more than one, because Python supports tuple assignments).