Category "class"

using kwargs in classes with python

I am getting really confused with using kwargs in classes below is my code class Get_Index_Change_Data: def __init__(self, **kwargs): self.idx_chg(*

Is it possible to inherit a parent class instance attribute directly into a child class instance in Python?

Here is the code that I have put together so far (and I understand why it does not work), but it illustrates what I am trying to achieve. First there is one pa

Continuous error in module: TypeError: Artist() takes no arguments

Working through an assignment, and have tried multiple changes to both the Class and the Module but I still am getting an error, "TypeError: Artist() takes no a

C++ change parent class based on option

There is a Student class inherited from Person. And there is Student class inherited from University. I want to change the parent class Person, University based

How to put class field into method argument to avoid code repeat

I am currently solving this issue. For example. I have two classes. One for item and second for some kind of records of these items. What I need to do, if I wan

Is there any way to embed a class Element into a class Element in Entity Framework?

This is my code: namespace MyProject.Models.Database { public class Recipe { public Guid Id { get; set; } = Guid.NewGuid(); public strin

Call helpers in a Jenkins Shared Library

I have a Jenkins Shared Library organized like that : +- src | +- main | +- jenkins_shared_library | +- helpers |

Why do we use __init__ in Python classes?

I am having trouble understanding the Initialization of classes. What's the point of them and how do we know what to include in them? Does writing in classes r

python: apply all functions inside a class to a user input

I have a class and a some functions that changes the user input and saves it in a file as follows. import os import pandas as pd from langdetect import detect

How do I compose different objects from a package/framework into a class or object the pythonic way?

Lets say I a have two objects of different framework that I cant alter (one is C implemented and the other uses a nested factory to instantiate): # framework_a.

Storing Objects assigned to user while using Flask [duplicate]

I come here to ask you a question about the way session can handle Objects in Flask. I have a Flask application and I want all my users to hav

Is there a way I can break up into more than 2 classes

I am wondering how/if I could possibly break this up into multiple classes but keep the values across objects to pass between both. I am unable to get things wo

I imported jsx files but can't use/ import it in ReactJS [closed]

I use these 2 classes : auth.js import React from 'react'; import log from './../components/log/'; const auth = () => { return (

CSV to PHP class properties

I'm working on an assignment right now, and I'm trying to take the data from a CSV and make them into class objects. So each item in the CSV row needs to be a c

error: new initializer expression list treated as compound expression [-fpermissive]

I am trying to write a playlist method for songs in c++, however, I keep running into frequent errors. template <typename T> struct cir_list_node {

Print data from Class instance

I want to print out data from a Class instance. I tried including data in str function, but this only works when value is at its default (an empty list). After

How can the __init__ method accept objects and assign attributes if the attributes have not been created in the Constructor? [duplicate]

I am new to OOP in Python. As the title suggests, I am unsure as to how the __init__ method can assign attributes to an object of a given clas

How can I access class members after creating a new object for that class?

I know my question doesn't really explain my problem all that well, but I'll try my best here. I have a graph program. It should add new vertices and edges, and

Tailwind CSS classes is not working in my project?

Here is my HTML link https://play.tailwindcss.com/fbB4GCL0ht VS Code setup pictures Tailwind.Config.js All files warn - No utility classes were detected in your

Architecture of sub-classes in C++

I learn C++ OOP-paradigm and want to ask related question: Assumption We have a base class: class Base { public: virtual SomeType PowerMethod() { return So