3 ms·
There is virtually no difference in this regard between Ruby and Python. I can swap those two words in your comment without affecting its quality.
by kazinator 3y ago
There is virtually no difference in this regard between Ruby and Python. I can swap those two words in your comment without affecting its quality.
- gorgoiler 3y agoIn my experience most Python I see is amenable to static analysis and type checking. It’s possible to do the same with some Ruby, but the language is designed to make it very easy to programmatically create new types. Do you not find that this drastically reduces the effectiveness and coverage of Ruby type checkers?
- kazinator 3y agoCreating a new class in Python at run time is pretty easy with the three-argument form of the type function: >>> NewClass = type('NewClass', (), {'foo':42}) >>> x = NewClass() >>> x.foo 42