On Sep 30, 2012, at 2:37 AM, Joachim Durchholz <[email protected]> wrote:

> Am 29.09.2012 22:58, schrieb Aaron Meurer:
>>> I'd suggest moving the singletons into the classes where they're created.
>>
>> I'm not sure if I understand you. The classes are the singletons.
>> "sympify(0) is S.Zero is Zero" is True.
>
> Heh. Pythonic ignorance on my part I guess.
> Backtracking and asking questions to get a picture of the situation now... 
> here goes:
>
> What's the advantage of writing down "S.Zero" if we can write "Zero"?
> Ah... *can* we even write "Zero"? (Not Zero(), that much I do understand :-) )
>
>>>> Also, unlike C, S only eats up those objects that specifically set it
>>>> as their metaclass. So the name clash issue that Ronan mentioned does
>>>> not apply. I also seriously doubt any external code uses S to create
>>>> its own singletons, though something like that would be perfectly
>>>> acceptable and supported, so long as the names don't clash with
>>>> existing names.
>>>
>>> They may clash with names created by other people who're using
>>> SymPy,  so freely combining code written by others isn't possible anymore.
>>> Also, they may clash with names that future versions of SymPy place in S.
>>
>> Well, it will be supported modulo any name clashes.
>
> I agree with that.
>
> > If you're worried
>> about it, you can choose a name that you know will never clash.
>
> 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.

Aaron Meurer

>
> As a SymPy user, I would be unable to control how others (including the SymPy 
> team) choose names, so couldn't prevent them from accidentally come up with 
> the same name as I do.
>
> Regards,
> Jo
>
> --
> 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.
>

-- 
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.

Reply via email to