Movatterモバイル変換


[0]ホーム

URL:


Sorry, we no longer support your browser
Please upgrade toMicrosoft Edge,Google Chrome, orFirefox. Learn more about ourbrowser support.
Skip to main content
Stack Overflow
  1. About
  2. For Teams
Loading…
How are we doing? Please help us improve Stack Overflow.Take our short survey
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives
1,223 questions
Filter by
Sorted by
Tagged with
Advice
1vote
4replies
71views

With abstract subclasses on can use register to add other classes as a "virtual" subclass, what would be a way to do that for a single instance based on it fullfilling some criteria?The &...
Minimo's user avatar
0votes
1answer
86views

I am using vscode for Python dev. I have the Microsoft Extensions (Pylance, Python, Python Debugger, PythonEnviroments) installed and working.The issue is when I try to make a metaclass in vscode ...
3votes
1answer
90views

I want to instantiate class with default value.Class have required parameters.Class must be singleton (can be implemented with smt other than metaclass).Data must be updated if try to instantiate ...
big_cat's user avatar
0votes
1answer
69views

I'm trying to wrap my head around the precise order of operations and interactions when a Python class definition involves a metaclass, a init_subclass method, and a class decorator.class Meta(type):...
user avatar
1vote
1answer
151views

I'm developing a Python interpreter from scratch in C++ as a hobby project to deepen my understanding of the language's internals.I'm currently stuck on implementing the attribute lookup mechanism (...
1vote
1answer
59views

I am writing a Python metaclass that creates a special index of class members that meet certain criteria, one criterion being that those members should not be functions. I am checking this criterion ...
0votes
2answers
178views

I have a metaclass which creates a generic class parametrized by a type var T.It also needs to know the same type at runtime, which I currently achieve by providing it as an additional argument.Both ...
1vote
1answer
77views

For a project, I want to prevent the use of certain methods in an overriding class.As this happens rather frequently, I am using a metaclass to block many methods at once (how and why is not within ...
0votes
2answers
112views

This is an attempt to write a Point class that counts how many instances have been created:class Point class << self def initialize @count = 0 end ...
0votes
1answer
166views

DescriptionI'm working with LightningDataModule and wanted to ensure that a method (_after_init) runs only once after full initialization, regardless of subclassing. For that, I implemented a custom ...
0votes
2answers
46views

I am trying to instantiate a singleton with constructor argument. However, passing the input arguments to the metaclass hits an error.from typing_extensions import List, TypedDict, Optional, Any...
0votes
3answers
123views

I have a SwiftUI View that I would like to be able to show one of many different other views:struct View1: View { var body: some View { Text("View1") }}struct View2: View ...
CPlus's user avatar
  • 5,130
1vote
1answer
83views

Given the following Python code:import ctypesfrom collections.abc import Mappingclass StructureMeta(type(ctypes.Structure), type(Mapping)): passclass Structure(ctypes.Structure, Mapping, ...
0votes
1answer
99views

Here is the code:class A: passclass B: passclass Example(A, B): pass ...a lot of method# new class B called BPlusclass BPlus: pass# want a new class Example that base on (A, BPlus) but ...
1vote
1answer
56views

I’m using a custom metaclass, to decorate methods of a class. However, it currently only decorates methods defined directly in the class and not those inherited from the parent class.My classes are ...
Shrey Patel's user avatar

153050per page
1
2345
82

Hot Network Questions

more hot questions
Newest metaclass questions feed

[8]ページ先頭

©2009-2025 Movatter.jp