class Questions

2

Solved

from pydantic import BaseModel class A(BaseModel): date = '' class B(A): person: float def __init__(self): self.person = 0 B() tried to initiate class B but raised error AttributeError: '...
Parcenary asked 25/11, 2022 at 12:39

5

Solved

I know the behavior, but I am not 100% sure on why this occurs. I understand that there is no polymorphism for instance variables in java. The variables are resolved statically by the compiler. But...
Blastoderm asked 20/8, 2012 at 21:52

3

For torch.nn.Module() According to the official documentation: Base class for all neural network modules. Your models should also subclass this class. Modules can also contain other Modules, allo...
Referent asked 18/4, 2020 at 11:19

6

Solved

I'm trying to answer the following question: A child class would not inherit certain members of the parent class. Name three such members. I know private members are not inherited to child c...
Aguilera asked 16/4, 2014 at 8:5

3

is there any way (native or extension) in VS Code to see class inheritance hierarchy of some class in Typescript? Something like Type Hierarchy view for Java classes in Eclipse? Thanx
Diophantus asked 8/2, 2019 at 12:19

4

Solved

I am trying to build a "type", for the Timecode convention used in Film/Animation. I want to accommodate use cases where a user may want to initialise the object with a Timecode string go...
Recusancy asked 5/9, 2023 at 19:30

3

How can I implement a get/set property with PowerShell class? Please have a look on my example below: Class TestObject { [DateTime]$StartTimestamp = (Get-Date) [DateTime]$EndTimestamp = (Get-Date...
Resolution asked 27/9, 2016 at 6:12

3

Solved

I'm trying to make a class instance property reactive to display the error message if authentication fails. userModel.ts export class User { private error: string; set errorMessage(errorMessage:...
Shamefaced asked 29/7, 2022 at 7:23

3

Solved

Is there a way to run unittests in pycharm in verbose mode. I am looking for a way to see the docstring in the test functions so that i can see some info of the ran test. class KnownValues(unittes...
Sandrasandro asked 22/4, 2017 at 16:43

2

Solved

I've search all over this site and google and I ended up creating this account... I need some help with php, traits and classes. I have this 2 different traits, that have some methods with the same...
Heddie asked 11/5, 2014 at 17:23

15

Solved

I have created the following Enum: from enum import Enum class Action(str, Enum): NEW_CUSTOMER = "new_customer" LOGIN = "login" BLOCK = "block" I have inherited f...
Presa asked 10/8, 2020 at 7:21

2

Solved

Currently if I create a class that implements an interface, the class created will all methods not included in the interface. Here's an example: interface ExampleTypes { alpha(); } class Example...
Hufuf asked 7/12, 2018 at 18:21

6

my problem is about i have a file that contain class and inside this class there is bunch of code will be executed so whenever i import that file it will executed ! without creating an object of ...
Astyanax asked 17/8, 2012 at 17:10

41

Here is my HTML link https://play.tailwindcss.com/fbB4GCL0ht Visual Studio Code setup pictures Tailwind.Config.js All files warn - No utility classes were detected in your source files. If this is...
Fleuron asked 10/2, 2022 at 18:56

12

Solved

I am exporting the following ES6 class from one module: export class Thingy { hello() { console.log("A"); } world() { console.log("B"); } } And importing it from another module: import {...
Olson asked 10/6, 2015 at 14:14

4

Solved

Today I'm viewing another's code, and saw this: class A(B): # Omitted bulk of irrelevant code in the class def __init__(self, uid=None): self.uid = str(uid) @classmethod def get(cls, uid):...
Visual asked 17/7, 2014 at 9:13

6

Solved

I'm trying to replace a function defined within a class in order to modify its function (as in inner workings) without changing the actual code. I've never done this before, and, hence, am having s...
Christlike asked 30/5, 2018 at 7:44

7

Solved

I'm trying to use bash scripting to make an script act like a phone book, so i tried to create classes and objects but unfortunately i couldn't find a way to do that ! so i'm asking how to create a...
Ahrens asked 21/4, 2016 at 13:27

3

Solved

I would like to know regarding following behavior of instanceof operator in Java. interface C {} class B {} public class A { public static void main(String args[]) { B obj = new B(); System.o...
Skepful asked 14/7, 2015 at 5:39

3

Solved

So I have the following class... class Pet { public: Pet() : id(0), name("New Pet") { } Pet(const int new_id, const std::string new_name) : id(new_id), name(new_name) { } Pet(const P...
Rosenstein asked 12/5, 2015 at 23:37

8

Solved

Is there any way to translate this Java code into Python? class Foo { final static private List<Thingy> thingies = ImmutableList.of(thing1, thing2, thing3); } e.g. thingies is an immuta...
That asked 13/9, 2011 at 18:52

5

Solved

I have an Object where I use it in multiple services, and each one should take some parameters, so I create two constructors, but TypeScript did not allow me to do this. My example is: class User {...
Winger asked 11/4, 2020 at 9:16

10

Solved

How do I restrict a class member variable to be a specific type in Python? Longer version: I have a class that has several member variables which are set externally to the class. Due to the way...
Ovoviviparous asked 16/2, 2012 at 4:54

6

I have started learning Java and picked up some books and collected materials online too. I have programmed using C++. What I do not understand is that ,even the main method is packed inside a Clas...
Individuation asked 6/12, 2010 at 8:4

4

Solved

Is there any way to use the ECMAScript6 class notation to declare either a static class variable or a default value for an instance variable? Without class what I have in mind would be written as ...
Monomolecular asked 3/2, 2015 at 20:56

© 2022 - 2024 — McMap. All rights reserved.