xkcd.com/353 ( Flying with Python )
MRAB
python at mrabarnett.plus.com
Sat Mar 30 12:31:59 EDT 2024
On 2024-03-30 11:25, Skip Montanaro via Python-list wrote:
>>
>> > https://xkcd.com/1306/
>> > what does SIGIL mean?
>>
>> I think its' a Perl term, referring to the $/@/# symbols in front of
>> identifiers.
>>
>
> I had a vague recollection of hearing it elsewhere (*Game of Thrones,* on
> the armies' battle flags?), but didn't know what it meant. Google tells me:
>
> *an inscribed or painted symbol considered to have magical power.*
>
> So, they're more than just line noise. They confer power on their users...
>
> Perhaps '@' in the context of decorators is the most prominent example in
> Python, since decorators technically don't allow the programmer to do
> something they couldn't before, but are now are used everywhere, a key
> feature of many applications and modules.
>
> Magical-ly, y'rs,
>
I wouldn't consider '@' to be a sigil any more than I would a unary minus.
In Perl there's the prefixes $ (scalar), @ (array) and %
(hash/dictionary), but also & (function), although it's rare because
there's also the () afterwards.
Variables in PHP have the prefix $ and only $.
In old versions of BASIC, string variables had the suffix $, and integer
variables the suffix %. Some versions also had the suffix # (for double
precision, I think).
More information about the Python-list
mailing list