Questions tagged [class-attributes]
170 questions
0
votes
2 answers
Unable to create a check condition(using else if condition) in protractor for a element which belongs to multiple classes
There is a scenario where I need to perform an action(delete or add) on a particular element. But that element may belong to different classes and depending on the classes, I have to perform the action on that element.
Below is the snippet of my…

amitesh shukla
- 49
- 1
- 12
0
votes
1 answer
Missing class attribute when calling other method in class
I'm a novice at all this stuff so please go easy on me!
I wrote a class to compute various vector results. Several methods call on other methods within the class to construct the results. Most of this works fine, except for a peculiar problem. …

Bill
- 653
- 2
- 7
- 20
0
votes
1 answer
What happens when calling a unbound function during class definition
I am trying to initialize a class attribute by calling a function. Please see below.
This code works as expected meanwhile it makes me confused.
To my understanding getmemtoto is a so-called unbound function which need to be called with a instance…

dproc
- 63
- 6
0
votes
0 answers
Python3.5 : Send datas through in tread socket
Edit : I changed title and question to be more related to my problem :
I try to exchange datas (dictionnaries mostly) between a server and a client, using a socket connexion. Size of exchanged datas is not always the same, so i made this class to do…

AlexMdg
- 115
- 1
- 8
0
votes
1 answer
Nested class attribute isn't being recognized as int
The Goal
I am trying to create a practice script that stores a menu that can have new items added to it.
The items are things like "battle animation", "text speed", or "subtitles".
And the menu will print out all its items like this
(notice the…

wimworks
- 283
- 3
- 15
0
votes
3 answers
Python - Transform class attributes at call time
Suppose I have the following class
class Headings:
standard_heading = {
'height': 3.72,
'width': 25.68,
'left': 1.65,
'top': 0.28
}
As an example, I want the following results where all values have been…

Ludo
- 2,307
- 2
- 27
- 58
0
votes
2 answers
How to access a variable using its name as a string
I was thinking of using a plist file to configure how I would upload a form to my server but then I realised I don't know how I could do one crucial part of this or even if this is possible since you can't dynamically declare variables with…

James Woodrow
- 365
- 1
- 14
0
votes
1 answer
python 3 How can a class-method attribute be created by referencing it before it exists?
I'm trying to solve a codewars problem that I'm not sure has a simple implementation in python. I want to dynamically create a class-method attribute simply by referencing it before it exists. It sounds so counter intuitive. How do you initialize…

dbconfession
- 1,147
- 2
- 23
- 36
0
votes
1 answer
Webservice expose a complex type to the client in wsdl
I have (to make things easy) 2 classes
1) abstract class A
2) inherited class B from A.
now i'm using a method "callMethod(A argument)"
which is exposing my abstract class in the wsdl.
But the problem is that on the client side i want to be able…

LolaRun
- 5,526
- 6
- 33
- 45
0
votes
0 answers
Dynamically assign nested attributes to a class in Python
I have a configuration file and would like to create a Config class that has attributes for the different sections and values in the config file.
For example, I have a yaml file (though json would also be fine), set up like this:
section1:
key1:…

Bianchi
- 138
- 1
- 2
- 7
0
votes
1 answer
HTML/CSS - Scrolling Nav not Allowing more than one Active Link on NAV
I am facing a weird problem, that I can't understand what is causing this.. maybe someone can help me? I tried to apply Scrolling Nav framework on my website..
Everything is already set like I want, design and stuff, the only problem is that I can't…

TiagoM
- 3,458
- 4
- 42
- 83
0
votes
1 answer
How to access class attributes of a derived class in the base class in Python3?
I want to do something in a base class (FooBase) with the class attribues of the derived classes (Foo). I want to do this with Python3.
class BaseFoo:
#felder = [] doesn't work
def test():
print(__class__.felder)
class Foo(BaseFoo):
…

buhtz
- 10,774
- 18
- 76
- 149
0
votes
1 answer
Access class hierarchy attribute
Given a class named DataStream
class DataStream(object):
def __init__(self):
self.start = start
self.input_val = input_val
and a class named InDataStream:
class InDataStream(DataStream):
def __init__(self):
super(…

vikram9866
- 91
- 4
0
votes
2 answers
How can I apply one or more attributes to all classes in a project?
How can I apply an attribute to all classes in a particular project?!
And is it enough to apply CLSCompliant attribute to just one class or do I have to apply to all classes?
Thanks for your answers...

Dr TJ
- 3,241
- 2
- 35
- 51
0
votes
1 answer
inheritance of set class attribute in python
I'm trying to create basic abstract class with mechanism for saving of set of all created instances.
class Basic(object):
__metaclass__ = ABCMeta
allInstances = set()
def __init__(self, name):
self.allInstances.add(self)
…

Azazell00
- 93
- 8