[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
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

added math symbols and some standard data types for python evaluation #793

Merged
merged 1 commit into from
Apr 13, 2016

Conversation

rhaschke
Copy link
Contributor

... as discussed in #784 (comment)

@@ -279,8 +280,11 @@ def _arg(resolved, a, args, context):
# context. We disable all the builtins, then add back True and False, and also
# add true and false for convenience (because we accept those lower-case strings
# as boolean values in XML).
_eval_dict={'true': True, 'false': False, 'True': True, 'False': False, '__builtins__': {},
_eval_dict={'true': True, 'false': False, 'True': True, 'False': False,
'__builtins__': {k: __builtins__[k] for k in ['list', 'dict', 'map', 'str', 'float', 'int']},
'env': _eval_env, 'optenv': _eval_optenv, 'find': _eval_find}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This block becomes more difficult to read as it grows. Can you update it to:

eval_dict = {
    'true': True, 'false': False,
    'True': True, 'False': False,
    '__builtins__': {k: __builtins__[k] for k in ['dict', 'float', 'int', 'list', 'map', 'str']},
    'env': _eval_env, 'optenv': _eval_optenv,
    'find': _eval_find
}

@dirk-thomas
Copy link
Member

One test failed.

@rhaschke
Copy link
Contributor Author

The failed tests are unrelated to roslaunch:

throttle: /usr/include/boost/thread/pthread/recursive_mutex.hpp:113: void boost::recursive_mutex::lock(): Assertion `!pthread_mutex_lock(&m)' failed.

@dirk-thomas
Copy link
Member

@rhaschke rhaschke force-pushed the roslaunch-math-expressions branch from fc3dec2 to 9888616 Compare April 13, 2016 19:26
@rhaschke
Copy link
Contributor Author

Oops. I missed that one. Hopefully fixed now. And squashed ;-)

@dirk-thomas
Copy link
Member

Thank you!

@dirk-thomas dirk-thomas merged commit c9fa90f into ros:kinetic-devel Apr 13, 2016
@rhaschke rhaschke deleted the roslaunch-math-expressions branch April 14, 2016 12:09
rsinnet pushed a commit to MisoRobotics/ros_comm that referenced this pull request Jun 19, 2017
added math symbols and some standard data types for python evaluation
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.

2 participants