List replication operator

Chris Angelico rosuav at gmail.com
Fri May 25 12:58:06 EDT 2018


On Sat, May 26, 2018 at 2:43 AM, bartc <bc at freeuk.com> wrote:
> On 25/05/2018 17:11, Alexandre Brault wrote:
>>
>>
>>
>> On 2018-05-25 11:40 AM, bartc wrote:
>>>
>>> On 25/05/2018 16:27, Chris Angelico wrote:
>>>>
>>>> You're way WAY too late to debate the matrix multiplication operator.
>>>
>>>
>>> /The/ matrix multiplication operator?
>>>
>>> In which language? And what was wrong with "*"?
>>>
>> In Python, the language we're discussing right now. What was wrong with
>> * is described in detail in PEP 465
>>
>>> (I've implemented matrix multiply in a language (although for
>>> specialised matrix types), and I used the same "*" symbol as was used
>>> to multiply anything else.)
>>>
>>> Anyway this is not matrix multiplication, but replication, and using
>>> '@' seems more a consequence of there not being any better ones
>>> available as they are already used for other things.
>>>
>> You're right, it's not matrix multiplication. And Pathlib's use of / is
>> not division, nor do C++'s streams use bitshifting.
>
>
> There's no need to be sarcastic.
>
> The context here for those symbols is programming source code for which
> binary or infix +, -, * and / symbols are VERY commonly used for add,
> subtract, multiply and divide operations.
>
> While some of them can sometimes be interpreted as various kinds of markup
> control when programming code is not distinguished from normal text, it can
> be particularly striking with @.

Why? Why is at-sign somehow more markuppy than asterisk, which is
*frequently* used to indicate emphasis? In fact, I have frequently run
into this, when sharing code snippets in chat systems that allow
Markdown or similar. Or if you're worried about linkification, the
humble period is far more significant. Your mail/news client might
choose to represent configure.ac as a link, since ".ac" is a valid
TLD. And datetime.date is technically valid as a domain name, though
I'm not sure if there's any actual dating site that shares a name with
this Python class.

Typable symbols are in short supply; they have different meanings in
different contexts.

ChrisA



More information about the Python-list mailing list