Steven D'Aprano wrote:
> On Tue, 05 Jun 2007 18:08:31 +, Lenard Lindstrom wrote:
>
>> Steven D'Aprano wrote:
>>> On Mon, 04 Jun 2007 22:19:35 +, Lenard Lindstrom wrote:
>>>
What is "magic" about __init__ and __repr__? They are identifiers just
like "foo" or "JustAnotherClass". T
On Tue, 05 Jun 2007 18:08:31 +, Lenard Lindstrom wrote:
> Steven D'Aprano wrote:
>> On Mon, 04 Jun 2007 22:19:35 +, Lenard Lindstrom wrote:
>>
>>> What is "magic" about __init__ and __repr__? They are identifiers just
>>> like "foo" or "JustAnotherClass". They have no special meaning to
Steven D'Aprano wrote:
> On Mon, 04 Jun 2007 22:19:35 +, Lenard Lindstrom wrote:
>
>> What is "magic" about __init__ and __repr__? They are identifiers just
>> like "foo" or "JustAnotherClass". They have no special meaning to the
>> Python compiler. The leading and trailing double underscore
On 5 Juni, 11:02, ai <[EMAIL PROTECTED]> wrote:
> I don't think it is magic. If you think it is magic, can you talk
> about what's the better way and how can you implement the functions
> without any magic. [...]
Well, in a sense I guess all reserved words can be considered magic,
but in Python yo
I don't think it is magic. If you think it is magic, can you talk
about what's the better way and how can you implement the functions
without any magic. I can't image a lauguage without special names.
There are some special names even in Lisp. I guess you just hate the
'__'.
On Jun 4, 2:43 pm, per
In <[EMAIL PROTECTED]>, per9000 wrote:
> Still, I have problems with "magic" functions, similar to magic
> numbers: http://en.wikipedia.org/wiki/Magic_number_%28programming%29
> f.x. calling all member-functions of a class to close files as
> illustrated in a previous post, or PyUnits magic "test*
On 4 Juni, 10:19, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
>
> [...]
>
> Now I'm a little confused. What does this have to do with magic names? I
> thought you are talking about names that start and end with two
> underscores (`__magic__`)!?
Indeed I am talking about two things at onc
On Mon, 04 Jun 2007 22:19:35 +, Lenard Lindstrom wrote:
> What is "magic" about __init__ and __repr__? They are identifiers just
> like "foo" or "JustAnotherClass". They have no special meaning to the
> Python compiler. The leading and trailing double underscores represent
> no special inca
per9000 wrote:
> Hi,
>
> I recently started working a lot more in python than I have done in
> the past. And I discovered something that totally removed the pretty
> pink clouds of beautifulness that had surrounded my previous python
> experiences: magic names (I felt almost as sad as when I disco
Josiah Carlson wrote:
> I don't believe that there is a full list of all __magic__ methods. The
> operator module has a fairly extensive listing of functions that call
> such methods, but I know that some have been left out.
There IS a full documentation of this special methods::
http://doc
On 4 Cze, 08:43, per9000 <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I recently started working a lot more in python than I have done in
> the past. And I discovered something that totally removed the pretty
> pink clouds of beautifulness that had surrounded my previous python
> experiences: magic names (
per9000 wrote:
> On Jun 4, 9:11 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
>> In <[EMAIL PROTECTED]>, per9000
>> wrote:
>> >
>> > [...]
>> >
>> > So another question emerges:
>> > * is the use of magic names encouraged and/or part of good coding
>> > practice.
>>
>> What do you mean
In <[EMAIL PROTECTED]>, per9000 wrote:
> On Jun 4, 9:11 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
>> In <[EMAIL PROTECTED]>, per9000 wrote:
>> >
>> > [...]
>> >
>> > So another question emerges:
>> > * is the use of magic names encouraged and/or part of good coding
>> > practice.
>>
On Jun 4, 9:11 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
> In <[EMAIL PROTECTED]>, per9000 wrote:
> >
> > [...]
> >
> > So another question emerges:
> > * is the use of magic names encouraged and/or part of good coding
> > practice.
>
> What do you mean by "use"? Implement them to o
per9000 wrote:
> So my questions:
> * is there a comprehensive list of magic names in python (so far i
> know of __init__ and __repr__)?
> * are these lists complete or can magic names be added over time (to
> the python "core")?
> * are magic names the same in different python versions?
I don'
In <[EMAIL PROTECTED]>, per9000 wrote:
> I just used a search engine a little on this topic and I found no
> comprehensive list of magic names in python.
They are usually mentioned in parts of the docs where the relevant
functionality is explained. For example in `Special method names`_ in the
r
16 matches
Mail list logo