Am 01.10.2012 06:03, schrieb Aaron Meurer:
On Sun, Sep 30, 2012 at 5:09 PM, Joachim Durchholz <[email protected]> wrote:
Am 30.09.2012 22:19, schrieb Aaron Meurer:
On Sun, Sep 30, 2012 at 2:17 PM, Joachim Durchholz <[email protected]>
wrote:
I don't understand - how can I know that a name will never clash?
If your module is called My Fun Module, you could name your class
MyFunModuleClass. Of course, your could shortcut it as just Class
everywhere in your code. The long name would just be to prevent
clashes in the SingletonRegistry.
Well... assume somebody else is writing a My Fun Module, too.
By following the same logic, he'll end with MyFunModuleClass.
Clash.
Yes, but then even "import myfunmodule" will be ambiguous. Of course
you *can* create a name clash, but realistically, it can be avoided.
How would one avoid such a clash then?
If you're so worried about it, use your own separate singleton registry.
Heh. I wouldn't use a singleton registry that's prone to name clashes
like this. I've been bitten by these over several times over the
decades, that's why I'm so insistent.
I conclude that S shouldn't be used by anybody but the SymPy team,
unless that somebody is 150% sure that his code won't ever be used by
anybody else.
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy?hl=en.