Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pvector_field with large amount of nested precord object structure failed in pypy #232

Open
pasinsjr opened this issue Jul 30, 2021 · 1 comment

Comments

@pasinsjr
Copy link

pasinsjr commented Jul 30, 2021

import pyrsistent as pyrs

class C(pyrs.PRecord):
    value = pyrs.field(int)

class B(pyrs.PRecord):
    dump_int: int = pyrs.field(int)
    value = pyrs.pvector_field(C)

class A(pyrs.PRecord):
    values_list = pyrs.pvector_field(B)

c_list = [
    C(value=3)
    for j in range(500)  # if you reduce this number to 100, it would work correctly
]

b_list = [
    B(
        dump_int=2,
        value=c_list
    )
    for i in range(8000)
]

dump_obj = A(
    values_list=b_list
)

print(type(dump_obj.values_list[0]))

got 'list' instead of 'B', the length number of array is different depend on machine

environment: PyPy 7.3.5 with GCC 7.3.1 20180303 (Red Hat 7.3.1-5)

@tobgu
Copy link
Owner

tobgu commented Aug 14, 2021

That's weird! I don't know off the top of my head why this would be but will try to find some time to dig into it. If you have further input please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants