PyneCore v6.0.12 - Bug Fixes and Color Interpolation
π New Features
Color Interpolation
- Color gradient support: Added
color.from_gradient()function for smooth color interpolation between two colors based on a value within a range - Enables advanced color transitions for indicators and visual elements
π Bug Fixes
Function Isolation
- Inner function shadowing: Fixed critical issue where inner functions that shadow Python builtin names (e.g.,
filter,max,min) weren't being properly isolated - Now correctly tracks shadowed builtins per scope and isolates them appropriately
- Prevents conflicts between user-defined functions and Python builtins
Persistent Variables
- Annotated assignments: Fixed bug where persistent variable references weren't being transformed in type-annotated assignments
- Example:
alpha: float = length_2now correctly transformslength_2to its persistent form - Added comprehensive test coverage for this scenario
Type System
- Generic type support: Enhanced
is_na()function to support GenericAlias types likelist[float] - Improves compatibility with modern Python type annotations
π§ͺ Testing
- Added new test cases for persistent variable transformation in annotated assignments
- Improved test coverage for edge cases and regression prevention
π Impact
These fixes improve Pine Script compatibility and prevent subtle bugs in compiled code, especially when using common function names or complex type annotations.