The class Expression deals with ObjectIdentifier::Component.
They both have a toString() method that takes a stream as first argument and a boolean as second. However, in Expression, the boolean means "persistent or not" (bool persistent). While in ObjectIdentifier::Component, the boolean means "quote for python or do not quote for python" (bool toPython).
So, as far as I see, there is not much relation between those two booleans. However, when one calls Expression::toString, s/he might end up calling Component::toString. This happens here. There, the used toPython is !persistent.
This means that if persistent is set to false, toPython will be set to true. And when persistent is set to true, toPython will be set to false.
Now, this does not make much sense to me. Can someone explain why this behaviour?
Member function Expression::toString() and Component::toString().
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
- andrecaldas
- Posts: 301
- Joined: Fri Jan 27, 2023 8:45 pm
- Contact:
- andrecaldas
- Posts: 301
- Joined: Fri Jan 27, 2023 8:45 pm
- Contact:
Re: Member function Expression::toString() and Component::toString().
Ping... @eivindkvedalen.
Re: Member function Expression::toString() and Component::toString().
He hasn't been active any more for more than 3 years. Better to ask realthunder: git commit a1417c5ffa52ea and git commit 93e60caa35