3 ms·
Thanks for your opinion. This project is so tiny, and it is based on package `threading`. We used the 'wild ways' as you mentioned before, but we just don't wan
by luoyusang2007 7y ago
Thanks for your opinion. This project is so tiny, and it is based on package `threading`. We used the 'wild ways' as you mentioned before, but we just don't want to copy the same code into every project or to pass the original arguments as a tuple(like 'threading.Thread' does). So we made a pip package.
As for 'defer'... The original reason why we implement 'defer' is that the name 'gogo' is used by someone else. Since 'gostyle' is the only choice, we tried to implement something else other than 'go' statement. So now we have 'defer' here...
Python can do everything, so can golang. There would be nothing wrong if someone thinks that nothing is needed to be created. I believe everybody here knows how to use 'with' in python... But think about the cross-language packages(actually we are writing our project in go and python simultaneously), those packages can not rely on 'with'. If you are facing a cross-language package with no `__exit__` method implemented, I don't think having a 'defer' available is bad.
Everyone can use this package for fun or use it for just avoiding creating threads with arguments passed via a tuple. This package is so tiny, using it is costless anyhow.
( ̄▽ ̄)"