Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

1). C++/Arduino for micro controllers ends up using more memory than micropython. I've managed to get the binary sizes to 1/4 by doing cross compiles and linking things my self.

2). Types hints are a terrible non-pythonic kludge to solve a people problem in code. People who want to write java with whitespace and no curly brackets love them. CPython has made a number of bad decisions lately that make the language less usable. I've moved quite a bit of my everyday code to PyPy. Since they eat their own dog food they are keeping their dialect sane.



Type hints are optional, why not just not use them?

How are you going to know the type of an object that gets passed to a function? Why is it better to go around the codebase looking for things instead of glancing at the function signature?


The type (class really) of an object tells you nothing about how it will behave. What you need to do is check the methods attached to the object, not class, at runtime:

1) Exist.

2) Behave how you want them to behave.

I've written plenty of code that got that done by using an assert just after the docstring.

People will monkey patch, if not in your code base, than in a library you're importing.


> Types hints are a terrible non-pythonic kludge to solve a people problem in code.

I have a love/hate relationship with type hinting in Python. I've been using them for about 2 years, and it still just feels... unnatural. I usually add enough so that my IDE (PyCharm) has better autocomplete and that any Sphinx generated docs have sufficient coverage of types I may have missed when adding @params.


I have mostly a hate relationship with them, because the people who use them do not write python. They write c# or java in python.

And you shouldn't need an IDE with a scripting language. That one of the main selling points for type hints has been "Your IDE will do things for you!" is a warning that this is a bad move. Again python is not java, and it shouldn't be trying to be java.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: