Point72 / Point72/csp

csp.Struct doesnt support property setters

Open
#153 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: bug
Dominant language
Python
Stars
441
Forks
90
Avg merge
1d 12m
Merged PRs (30d)
5

Description

At the moment looks like csp.Struct wont properly process setattr calls when setting via a property, it wouild be very useful to get this to work.

Sample repro:

class S(csp.Struct):
    _a : int

    @property
    def a(self):
        return self._a

    @a.setter
    def a(self, x):
        self._a = x
s = S()
s.a = 1
Traceback (most recent call last):
  File "/home/ra7293/pycharm-community-2023.1.2/plugins/python-ce/helpers/pydev/pydevconsole.py", line 364, in runcode
    coro = func()
  File "<input>", line 1, in <module>
AttributeError: PyStruct.cpp:setattr:432:AttributeError: 'S' object has no attribute 'a'

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Run the Python reproduction first, then trace csp.Struct attribute handling into the PyStruct.cpp:setattr path named in the traceback. Check how property setters are recognized and add or update focused coverage if the repository has relevant tests; done means assigning s.a invokes the setter without the AttributeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
stream-processing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.