class X2:
def __init__(self, a, b, c)
self.a = a
self.<complete:a,b,or c>
This is handy because it helps avoid typing the member
names over and over - once for slots, once for the init
parameters, and once for the assignment.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
2 isn't a "correct" completion, just a handy one, to
pretend that all the parameters to __init__ will be made
into member variables of the same name in __init__.
Probably if you add it, it should be an option to turn it
on or off.
So, no - X2 isn't a subclass of X1.
really it's for a case like:
class A:
def __init__(self, someReallLongMemberName=None):
self.some<complete> = some<complete>
so that you can just type the name once and complete it
twice.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Well, if you take a look at the pydev-code list you'll see
that there is a script that will do what you want in that
case, that is putting the parameters as attributes for a
method, so, with that, the code-completion proposed does not
seem like a good solution to me...
Cheers,
Fabio
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Logged In: YES
user_id=617340
Hi,
What do you mean exactly by number 1?
Number 2 already has a feature request:
https://sourceforge.net/tracker/index.php?func=detail&aid=1442400&group_id=85796&atid=577332
Cheers,
Fabio
Logged In: YES
user_id=400635
1.
class X1:
__slots__ = ('a', 'b', 'c')
def anymethod(self):
self.<complete:a,b,or c>
2.
class X2:
def __init__(self, a, b, c)
self.a = a
self.<complete:a,b,or c>
This is handy because it helps avoid typing the member
names over and over - once for slots, once for the init
parameters, and once for the assignment.
Logged In: YES
user_id=617340
Ok, fair enough... Actually, it already does something like
that as:
class X1:
properties.create(a = 10, b = 20)
Because I had that as a previous request... So, shouldn't be
hard to extend it.
The only thing is that I didn't get the example2
correctly... Did you mean that X2 is a subclass of X1?
Logged In: YES
user_id=400635
2 isn't a "correct" completion, just a handy one, to
pretend that all the parameters to __init__ will be made
into member variables of the same name in __init__.
Probably if you add it, it should be an option to turn it
on or off.
So, no - X2 isn't a subclass of X1.
really it's for a case like:
class A:
def __init__(self, someReallLongMemberName=None):
self.some<complete> = some<complete>
so that you can just type the name once and complete it
twice.
Logged In: YES
user_id=617340
Well, if you take a look at the pydev-code list you'll see
that there is a script that will do what you want in that
case, that is putting the parameters as attributes for a
method, so, with that, the code-completion proposed does not
seem like a good solution to me...
Cheers,
Fabio