On 2017-03-02 14:19, Marc Mezzarobba wrote:
Jeroen Demeyer wrote:
(4) __pari__(): consistent with Python (__int__, __str__) and NumPy
(__array__). However, creating such names possibly goes against the
Python documentation [2].

Why "possibly"? The way I understand [2] is that __names__ are reserved
for use by the Python interpreter and standard library, period.

As I have said before, NumPy have invented __array__ too. And I don't think that the Python Naming Police came to hunt them down.

What bothers me about [1] and [2] is that they do not say which names should be used for custom special methods.

[1] https://www.python.org/dev/peps/pep-0008/#descriptive-naming-styles
[2] https://docs.python.org/3/reference/lexical_analysis.html#reserved-classes-of-identifiers

But if you want to do the same with all conversion
methods, there could well be a conflict with some future standard python
module.

*Any* name has the potential to clash with Python or with other packages. And I don't think that __pari__ is much more likely to clash than any other of the proposed names.

--
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to