Skip to content

Upper case variable names in functions causes ruby error: dynamic constant assignment #9

@jayvdb

Description

@jayvdb

Python

def f():
  CODES = {"KEY": 1}
  return CODES

becomes

def f()
  CODES = {"KEY" => 1}
end

Ruby complains that CODES is a constant, when it was a local variable in Python.

foo.rb:2: dynamic constant assignment
  CODES = {"KEY" => 1}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions