TimefoldAI / timefold-solver-python

Timefold Solver is an AI constraint solver for Python to optimize the Vehicle Routing Problem, Employee Rostering, Maintenance Scheduling, Task Assignment, School Timetabling, Cloud Optimization, Conference Scheduling, Job Shop Scheduling, Bin Packing and many more planning problems.
https://timefold.ai
Apache License 2.0
36 stars 3 forks source link

chore: Rename internal methods of PythonLikeObject to use '$' instead of '__' #18

Closed Christopher-Chianelli closed 4 months ago

Christopher-Chianelli commented 4 months ago
Christopher-Chianelli commented 4 months ago

PythonLikeObject is accessible from Python due to JPype; the __ was to make Python use name-mangling (https://docs.python.org/3/tutorial/classes.html#private-variables). But using a completely impossible name (as $ not allowed in Python identifiers) is better. Additionally, it should prevent classes with most Java interfaces (which typically don't use $ in their method names).