Skip to content

Enhance the ParsedValue.value setter to correctly update object attributes#23

Open
paul356 wants to merge 1 commit intopsychogenic:mainfrom
paul356:enhance_value_setter
Open

Enhance the ParsedValue.value setter to correctly update object attributes#23
paul356 wants to merge 1 commit intopsychogenic:mainfrom
paul356:enhance_value_setter

Conversation

@paul356
Copy link

@paul356 paul356 commented Sep 14, 2025

Sometimes we may want to add a new attribute to a node by assign a sexpdata tree to .value. But the fields are not updated according to the new value. For example _value and children is not updated which may causes problem if further operations depend on these fields.

This enhancement is to enhance the ParsedValue.value setter to update the fields according to assignee. I have verified the new function by adding a hide = yes attribute to a property string. The test code is like.

sch.symbol.C70.property.LCSC_Part__.effects.value = [[Symbol('font'), [Symbol('size'), 1.27, 1.27]], [Symbol('hide'), Symbol('yes')]]
OVERWRITING font
sch.symbol.C70.property.LCSC_Part__.effects
<effects [font = [<size [1.27, 1.27]>], hide = True]>
sch.symbol.C70.property.LCSC_Part__.effects.tree
[Symbol('effects'), [Symbol('font'), [Symbol('size'), 1.27, 1.27]], [Symbol('hide'), Symbol('yes')]]
sch.symbol.C70.property.LCSC_Part
_.effects.value
sch.symbol.C70.property.LCSC_Part
_.effects.font
font = [<size [1.27, 1.27]>]
sch.symbol.C70.property.LCSC_Part__.effects.hide
hide = True

@paul356 paul356 changed the title Enhance the ParsedValue.value setter to accept a sexpdata tree Enhance the ParsedValue.value setter to correctly update object attributes Sep 14, 2025
@paul356
Copy link
Author

paul356 commented Dec 3, 2025

@psychogenic Hi Pat. Do you have time to review this enhancement?

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

Successfully merging this pull request may close these issues.

1 participant