vmo icon indicating copy to clipboard operation
vmo copied to clipboard

Change first state's feature / symbol

Open tbazin opened this issue 9 years ago • 3 comments

I think having (for all newly created oracle) oracle.symbol[0] == None rather than oracle.symbol[0] == 0 would make more sense. What do You think about it?

tbazin avatar Jul 12 '15 05:07 tbazin

I think it was setup like that so when casting something like y = numpy.array(oracle.symbol) you do not have to worry about the type, but at the end I think it`s an implementation choice since most of the time we start from oracle.symbol[1:]. What do you think?

wangsix avatar Jul 12 '15 16:07 wangsix

Yes, I can see that. But changing it to None actually doesn't pose a problem when doing such a cast (since Python's lists and arrays don't have a single-type content requirement).

And in my opinion, it is better to worry about the types (unless You're working with inheritance or subtyping and it actually makes sense not to want to worry about the types, since it is all properly handled by the language) when something is so implementation dependant and not really semantic. (Plus, in that perspective, one would constrain all symbols to be of type int, which isn't the only meaningful way to see things. Why not chars for instance?)

tbazin avatar Jul 12 '15 23:07 tbazin

Alright, it does actually mess up the codebase, You were right. And then again, the typing system in Python being what it is, Your way of seeing things also makes sense. I'm being too demanding with it at times.

Might have to think more about that one before changing anything!

tbazin avatar Jul 15 '15 06:07 tbazin