stranac wrote:Why not normally create two classes, instead of using type()?
That would probably be simpler and more readable.
/is confused by your question
1: I'm trying to make it easy for python noobs dealing with files to write a script for my program
I want it to return the value as it's type so the noobs won't have stupid questions... heh
2: I need the types to match...
what I mean is the function doesn't instantiate the class... you do, in the script...
so we need bu() to return the same object as BU(), but it's up to the object to identify and maintain that data.
(such as memory overflows and such, though it caps it when that happens)
I don't want the importer to stop unless it absolutely has to
(meaning for u8() vertices, if it's capped before it's parsed as a float, it'll just display improperly.)
^ the import is still successful even though the data turned out to be invalid
stranac wrote:Also, making subclasses of int callable seems...silly.
I know... I want to leave a loose end in case I need support for that type of analysis
the data I'm dealing with is model data from MANY various platforms...
so there may be a case where I'll need to test the data before I can send it to the program.
(I doubt it, but I've seen some pretty weird formatting back in my days... heh)
another reason for these data types is pointer validation in memory objects
(thus partly the reason for the modified value becoming an int)
or am I just sounding stupid and highly over-thinking things??
should I explain even further back??
or perhaps just show you my program:
public repo: https://www.dropbox.com/sh/9c6s8kg3jd3gqje/5_mWYuuuT1
recent progress images: http://picasaweb.google.com/Tcll5850/UMC#
note, the linked stuff is for dev4... the code here is for dev5 which is a complete rehaul over everything.
also... I now finally understood your question XD
(curse my autism)
the reason for type() is to create a new class based off the byte-size and profile it for reference as explained in my last message
creating 2 classes would basically allow: bu(1) == bu(2) >>> True
as bu(1) >>> <class '__main__.BU_'>
and bu(2) >>> <class '__main__.BU_'>
and it would also not match the type reference:
bu(1) == BU(1) >>> False
from the current standpoint:
>>> bu(1) #or BU(1) (create the class)
>>> bu(1) #or BU(1) (reference the class)
there is a simple way I could pull this off, but that means the user has to set and option such as:
I don't want the user to know about that.
"user" as in the noob building the script.