Skip to content

Commit ab61d77

Browse files
committed
[GR-68498] Fix the magic-iter.py benchmark
* The previous version led to a lot of polymorphism. * The C variant in c-magic-iter.py stores `pos` in the instance so we should too.
1 parent db5ea02 commit ab61d77

File tree

1 file changed

+2
-2
lines changed
  • graalpython/com.oracle.graal.python.benchmarks/python/micro

1 file changed

+2
-2
lines changed

graalpython/com.oracle.graal.python.benchmarks/python/micro/magic-iter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
22
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
33
#
44
# The Universal Permissive License (UPL), Version 1.0
@@ -38,8 +38,8 @@
3838
# SOFTWARE.
3939

4040
class CustomIterator:
41-
pos = 0
4241
def __init__(self, obj):
42+
self.pos = 0
4343
self.__obj = obj
4444

4545
def __iter__(self):

0 commit comments

Comments
 (0)