Python Forum
Python class members based on a type value
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python class members based on a type value
#3
(Apr-07-2025, 04:54 PM)Gribouillis Wrote: In Python I would create a base class and two subclasses

Yes, I thought of that too. But that does not achieve the goal because you have *two* different classes, not one class that has different members like the struct.
Reply


Messages In This Thread
RE: Python class members based on a type value - by voidtrance - Apr-07-2025, 05:05 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Create a new subclass in a Python extension based on an existing class voidtrance 6 1,385 Mar-25-2025, 06:37 PM
Last Post: voidtrance
  Changing client.get() method type based on size of data... dl0dth 1 718 Jan-02-2025, 08:30 PM
Last Post: dl0dth
  associating members in a list to more than one features rezagholi 0 1,205 Mar-09-2023, 03:33 PM
Last Post: rezagholi
  Use a class type in it MathisDELAGE 2 1,772 Jan-29-2023, 11:37 AM
Last Post: MathisDELAGE
  search a list or tuple for a specific type ot class Skaperen 8 3,605 Jul-22-2022, 10:29 PM
Last Post: Skaperen
  Python generics: How to infer generic type from class attribute? Thoufak 0 3,780 Apr-25-2021, 09:31 AM
Last Post: Thoufak
  How to change 0 based indexing to 1 based indexing in python..?? Ruthra 2 5,935 Jan-22-2020, 05:13 PM
Last Post: Ruthra
  Type hinting - return type based on parameter micseydel 2 3,165 Jan-14-2020, 01:20 AM
Last Post: micseydel
  Object and type class Uchikago 2 2,835 Jul-28-2019, 10:35 AM
Last Post: DeaD_EyE
  How I can fill class members? AlekseyPython 0 2,057 Feb-14-2019, 06:32 AM
Last Post: AlekseyPython

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020