Search code examples
pythonarraysodoo

No ideas of this two equals of the Python Array "RELEASE_LEVELS = [ALPHA, BETA, RELEASE_CANDIDATE, FINAL] = ['alpha', 'beta', 'candidate', 'final']"


I see

RELEASE_LEVELS = [ALPHA, BETA, RELEASE_CANDIDATE, FINAL] = ['alpha', 'beta', 'candidate', 'final']

in odoo/conf/release.py of odoo project. I am assuming it's python array. but can't find any detail of it.

What does the two equals mean?


Solution

  • This is a short way to write

    ALPHA, BETA, RELEASE_CANDIDATE, FINAL = 'alpha', 'beta', 'candidate', 'final'
    RELEASE_LEVELS = [ALPHA, BETA, RELEASE_CANDIDATE, FINAL]
    

    So first it sets the four variables to the corresponding strings, then it sets RELEASE_LEVELS to a list (not array) of those four strings.