python27-syntax-reviewer

Reviews Python code for Python 2.7 compatibility in NetEase MC runtime environments.

Updated Apr 11, 2026
One-click install
npx skills add https://github.com/Coral5644/NekansModPack --skill python27-syntax-reviewer-coral5644
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: python27-syntax-reviewer
Source: https://github.com/Coral5644/NekansModPack/tree/main/.cursor/skills/python27-syntax-reviewer
Command: npx skills add https://github.com/Coral5644/NekansModPack --skill python27-syntax-reviewer-coral5644

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? NetEase MC runs on Python 2.7.18, so any Python 3 syntax (f-strings, type annotations, yield from, etc.) causes the engine to crash. This Skill enforces syntax downgrading checks when writing or reviewing code for that runtime. ## Core Features & Use Cases - Fatal Syntax Red-Line Table: Maps forbidden Python 3 constructs (f-strings, inline type hints, super() without arguments, raise ... from) to their required Python 2.7 equivalents. - Post-Writing Checklist: An 8-point verification list covering encoding headers, explicit object inheritance, comment-style type annotations, iteritems() usage, integer division behavior, and xrange() for large loops. - Use Case: When writing a new module for a NetEase MC mod, run this review to catch f-string formatting or missing (object) inheritance before the code crashes the game engine. ## Quick Start Review my newly written Python module for Python 2.7 compatibility issues before deploying it to the NetEase MC runtime.

Frequently Asked Questions about python27-syntax-reviewer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I make Python code compatible with Python 2.7?▼

Replace Python 3 constructs with 2.7 equivalents: use .format() or % instead of f-strings, # type: comments instead of inline annotations, super(MyClass, self) instead of bare super(), and explicit (object) inheritance for all classes.

How to review code for Python 2 vs Python 3 syntax differences?▼

Check for f-strings, inline type hints, yield from, raise ... from, and division behavior changes. This Skill provides a red-line mapping table plus an 8-point checklist covering encoding headers, class inheritance, and xrange usage.

Why does NetEase MC crash when running my Python mod code?▼

NetEase MC runs on Python 2.7.18, so any Python 3 syntax such as f-strings or inline type annotations causes the engine to crash. Downgrade all syntax to Python 2.7 equivalents before deployment.

Should I use range or xrange in Python 2.7 loops?▼

Use xrange() for large loops (over 1000 iterations) because it avoids building a full list in memory. range() is acceptable for small loops where memory overhead is negligible.

How do I add type hints in Python 2.7 code?▼

Use comment-style annotations like '# type: (int) -> str' on the line after the function definition, or '# type: str' after variable assignments. Inline annotation syntax is not supported in Python 2.7.