Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [4.1.1] - Unreleased

### Fixed
- #73: No longer errors when a `[ Language = python ]` method has quoted name like "__iter__"

## [4.1.0] - 2025-11-13

### Added
Expand Down
4 changes: 4 additions & 0 deletions cls/TestCoverage/Data/CodeUnit.cls
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,10 @@ Method UpdateSourceMap(pSourceNamespace As %String, ByRef pCache) As %Status
// %Foo() becomes _Foo() in the Python code unit.
Set tCLSMethodNum = pCLSCodeUnit.MethodMap.GetAt($Replace(tMethod,"_","%"))
}
If (tCLSMethodNum = "") {
// Special Python methods like __iter__ are stored as "__iter__" (with quotes) in CLS
Set tCLSMethodNum = pCLSCodeUnit.MethodMap.GetAt(""""_tMethod_"""")
}
Set tMethodStart = ..MethodMap.GetAt(tMethod)
Set tMethodEnd = ..MethodEndMap.GetAt(tMethod)
Set tMethodName = tMethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,9 @@ ClassMethod PythonWeirdSpacing() [ Language = python ]
return [element * 2 for element in x]
}

Method "__iter__"() [ Language = python ]
{
return self
}

}
Loading