Questions tagged [dynamic-class-creation]

Some Object Oriented programming languages allow creating new classes (types) in run-time (as compared to classes defined in the source code and created in compilation time)

Some examples of creating types in run-time:
C#
C++
Java
Python

78 questions
0
votes
1 answer

Selenium Webdriver and Type constructors using Generics - How to do it

What's the best way to use the PageFactory design with selenium 2 webdriver, but when a page doesn't always load an expected page how can I create the new unexpected page? public class PassengerPage { [FindsBy(How = How.Id, Using "submitId") …
0
votes
1 answer

How can I convert an OpenAPIv3/swagger spec into a proxy around an API using Python and Prance library?

I'm building an automatic proxy generator around any arbitrary API given it's swagger document. The intended output would be a python module that could be used as a client for said API. The API itself would import the proxy generator, point it at…
RobertLD
  • 77
  • 7
0
votes
0 answers

Automate object and .pickle file creation

I am creating a registration program (like the fields for Person and Email that you see at the front of notebooks), in order to implement some concepts into a bigger project. I'm trying to store multiple objects in a .pickle file. I tried the…
0
votes
1 answer

[Vue warn]: Error in render: "TypeError: _vm.stepProgression is not a function"

I'm creating a stepper component with a v-for loop, which currently works without an issues:
  • 0
    votes
    0 answers

    importing dynamically generated class definitions from a dynamically generated dictionary inside __init__.py namespace

    I have a Class Factory that generates classes with dynamic name assignment I like to be able to access them from other modules which import a package A currently I am loading the classes into a dictionary and updating the vars() of the init.py which…
    0
    votes
    0 answers

    Dynamically extend `__del__` cleanup code on an instance

    I want to bind a dynamically created namedtuple to a class When an instance of the class is initialized, a new namedtuple-type is created, and registered in globals() (this allows pickling). When the instance is deleted, I want to perform cleanup…
    Hyperplane
    • 1,422
    • 1
    • 14
    • 28
    0
    votes
    1 answer

    OData Queries on Entities with Dynamic Fields

    I am using OData on a dynamic model. The MyObject data is stored in two different ways on the database - in a main MyObject table and in a secondary table of key/value pairs. The allowed field names for the secondary table are stored in a third…
    0
    votes
    0 answers

    Python change the scope of classes dynamically created with type() function

    I have a factory class with a method that generates classes dynamically. This class is within a factory.py file. class Factory: def __init__(self, ast): self.ast = ast self.classes = {} def run(self): for item in…
    ibi0tux
    • 2,481
    • 4
    • 28
    • 49
    0
    votes
    0 answers

    Dynamically create a class inherited from neomodel.StructuredNode

    Python's library neomodel provides the ability to define a relationship with a class that hasn't been defined yet, by using its name as string, which works fine as follows: from neomodel import StructuredNode, RelationshipTo # if Foo is already…
    0
    votes
    2 answers

    Dynamic Class Creation python with metaclass involved

    i am trying to create an instance of a class using arguments, and the problem is my meta class needs some positional args to decide about the bases of class creation. here is an example to clear it more: Here are the childs which will be methods of…
    0
    votes
    1 answer

    When is the __prepare__ method of a metaclass excuted and what uses its return value?

    PEP 3115 has the following example of using the __prepare__ method of a metaclass (print statements are mine): # The custom dictionary class member_table(dict): def __init__(self): self.member_names = [] def __setitem__(self, key,…
    joseville
    • 685
    • 3
    • 16
    0
    votes
    1 answer

    ByteBuddy intercepting constructor arguments

    I am trying to dynamically create a class using ByteBuddy with my custom constructor. I have read the Intercepting default constructor with Byte Buddy and I have written the following code base on that. Class dynamicType = new…
    0
    votes
    1 answer

    Segmentation Fault with Dynamic Class (homework problem)

    I'm attempting to convert a working static String class to a dynamic String class using pointers, but when I implement the pointer it throws a segmentation fault error. Code below: mystring1.h: //File: mystring1.h // Declaration file for…
    0
    votes
    1 answer

    Dynamic Class Load file is not updating on server

    When I changed something in a file containing a dynamic class who's name is called from database. its working fine for the local server, but it is not updating on the live server until I change the file name and upload it again. could anyone what's…
    0
    votes
    2 answers

    Why ths php dynamic object class creation is not working?

    I am trying to create a class (working as factory class) in my Zend Expressive APP as follows: declare(strict_types=1); namespace App\Install\Factory; use App\Install\Model as Models; use App\Install\Abstracts\AttributeInterface; class…