-
Notifications
You must be signed in to change notification settings - Fork 160
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
Update resource_library.py #55
base: master
Are you sure you want to change the base?
Conversation
48行{base_dir, src}改为[base_dir, src]
Hi, thanks for your contribution. Since you mentioned in WeChat, there are other incompatible issues in resource_library.py with Python3. Do you mind fixing those issues in this RP altogether? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @tushushu I left one comment.
Generally speaking, you change is ok. So please let me know if you want to make another change or left as it is.
Also, I'd prefer to squash these three commits into one since they are small and all for fixing Python3 compatibility issue.
P.S: You can @ me in new comment. Otherwise I won't get email notification if you just edited in the first post
# Assume 'reduce' fuction needs to be imported in this way in future versions. | ||
version_info = int(sys.version.split('.')[0]) | ||
if version_info > 2: | ||
from functools import reduce |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can just use reduce
from functools
in python2 and python3 since the doc https://docs.python.org/2/library/functools.html#functools.reduce states that it's the same function with built-in reduce
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much for letting me know this, and I prefer to use "from functools import reduce" directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, I will wait until you push a new change
print >> hfile, '#ifdef __cplusplus' | ||
print >> hfile, 'extern "C" {' | ||
print >> hfile, '#endif' | ||
print('#ifdef __cplusplus', file=hfile) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we replace all those print
calls? You can use ''' '''
to output multiple lines of text for better understanding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simple is better than complex.
Line 48: {base_dir, src} has been changed to [base_dir, src]
@advancedxy Hi there, I am going to fix those issues later~