←back to thread

490 points jarmitage | 1 comments | | HN request time: 0.555s | source
Show context
paulluuk ◴[] No.40681492[source]
While this is really cool, I have to say..

> import warp as wp

Can we please not copy this convention over from numpy? In the example script, you use 17 characters to write this just to save 18 characters later on in the script. Just import the warp commands you use, or if you really want "import warp", but don't rename imported libraries, please.

replies(5): >>40681523 #>>40681706 #>>40681974 #>>40683394 #>>40685824 #
hoosieree ◴[] No.40681974[source]
The more Python I write, the more I feel that "from foo import name1,name2,nameN" is The Way. Yes it's more verbose. Yes it loses any benefits of namespaces. However it encourages you to focus on your actual problem rather than hypothetical problems you might have someday, and the namespace clashes might have a positive unintended consequence of making you realize you don't actually need that other library after all.
replies(2): >>40683519 #>>40712466 #
1. water-your-self ◴[] No.40683519[source]
> the namespace clashes might have a positive unintended consequence of making you realize you don't actually need that other library after all.