• 0 Posts
  • 17 Comments
Joined 2 years ago
cake
Cake day: August 22nd, 2023

help-circle








  • Well fair enough but I still like the fact that len makes the aim and the object more transparent on a quick look through the code which is what I am trying to get at. The supporting argument on bools wasn’t’t very to the point I agree.

    That being said is there an application of “not” on other classes which cannot be replaced by some other more transparent operator (I confess I only know the bool and length context)? I would rather have transparently named operators rather than having to remember what “not” does on ten different types. I like duck typing as much as the next person, but when it is so opaque (name-wise) as in the case of “not”, I prefer alternatives.

    For instance having open or read on different objects which does really read or open some data vs not some object god knows what it does I should memorise each case.




  • Yea and then you use “not” with a variable name that does not make it obvious that it is a list and another person who reads the code thinks it is a bool. Hell a couple of months later you yourself wont even understand that it is a list. Moreover “not” will not throw an error if you don’t use an sequence/collection there as you should but len will.

    You should not sacrifice code readability and safety for over optimization, this is phyton after all I don’t think list lengths will be your bottle neck.




  • Almost all forms of political campaigns. I think every candidate should be given some modest and equal amount of TV time (in a channel that is specially dedicated to this) to explain their ideology and plans for their next term and allowed to distribute one type of written booklet to communicate it and then that is it. The second you allow more than this money starts having a huge influence on results. Of course this still does not prevent huge amounts of billionaire owned social media and news outlets for disinformation campaigns so this would only be a start.