Skip to content

fix: replace walrus operator for Python 3.6 compatibility#78

Merged
boolangery merged 1 commit into
masterfrom
fix/issue-77
Jul 19, 2026
Merged

fix: replace walrus operator for Python 3.6 compatibility#78
boolangery merged 1 commit into
masterfrom
fix/issue-77

Conversation

@boolangery

Copy link
Copy Markdown
Owner

What Problem This Solves

The walrus operator (:=) was introduced in Python 3.8. The project declares support for Python 3.6 and 3.7 in setup.py classifiers, but the walrus operator at builder.py:684 would break on those versions.

Why This Change Was Made

Replace the walrus operator with a traditional two-line assignment pattern — an else block with an explicit if m: check. This is functionally identical but compatible with Python 3.6+.

User Impact

Users on Python 3.6 and 3.7 can now use luaparser without hitting a syntax error.

Evidence

  • All 147 tests pass
  • Double-square-bracket strings continue to parse correctly

Fixes #77

…compatibility

The walrus operator (:=) was introduced in Python 3.8. Replace it
with a traditional two-line assignment to maintain compatibility
with Python 3.6 and 3.7 as declared in setup.py classifiers.

Fixes #77
@boolangery
boolangery merged commit d50d9df into master Jul 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

remove warus operator from builder.py

1 participant