Update resource_library.py#55
Update resource_library.py#55tushushu wants to merge 3 commits intobaidu:masterfrom tushushu:patch-1
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? |
advancedxy
left a comment
There was a problem hiding this comment.
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.
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.
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.
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.
can we replace all those print calls? You can use ''' ''' to output multiple lines of text for better understanding.
chunyang-wen
left a comment
There was a problem hiding this comment.
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~