Skip to content

wrong results when calling function twice #9

Description

@fabianp

running test/test_func.py


Line # Mem usage Increment Line Contents
==============================================
2 @profile
3 def test_1():
4 7.73 MB 0.00 MB # .. will be called twice ..
5 7.73 MB 0.00 MB a = 2.
6 7.73 MB 0.00 MB b = 3
7 7.61 MB -0.12 MB c = {}
8 7.80 MB 0.19 MB for i in range(1000):
9 7.80 MB 0.00 MB c[i] = 2
10 7.80 MB 0.00 MB c[0] = 2.

but correct results should be the same as calling the function once:


Line # Mem usage Increment Line Contents
==============================================
2 @profile
3 def test_1():
4 7.57 MB 0.00 MB # .. will be called twice ..
5 7.59 MB 0.02 MB a = 2.
6 7.59 MB 0.00 MB b = 3
7 7.59 MB 0.00 MB c = {}
8 7.73 MB 0.14 MB for i in range(1000):
9 7.73 MB 0.00 MB c[i] = 2
10 7.73 MB 0.00 MB c[0] = 2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions