What I Don't Like About Python 41

Posted by tottinger Wed, 18 Jul 2007 02:41:00 GMT

I love python.

I love the simplicity, the nice data types, the strong dynamic typing, the significant indentation, the runtime flexibility, the list comps, the generators, they way that I can get work done in Python. I love the built-in help. I dig the Tao of Python.

There are still a few bits that seem artificial and clumsy. I was told that you don’t really know a language if there are not five things you hate about it. I have more than five, but these will do for now:

    • Dir is not a very good name for the method that dumps the contents of an object. I don’t like the ruby alternative, where methods and members are separate, but I just don’t like the naming here. A change would be possible. It would have to be grandfathered in, but it could happen.
    • double-underscores annoy me. I would like to see some other way of denoting operators and other magic functions. I suppose one could grandfather-in a decorator-based trick for defining operators. It would be a real compatibility breaker, but I really feel that __getitem__ is probably not the best naming our guys could come up with.
    • __name__ has always felt like a hack to me. Try explaining it to a novice programmer, or worse to someone who programs in perl or ruby or java for a living. Comparing the magic variable __name__ to the magic constant ”__main__” feels doubly so. I would rather have a convention such as naming a method “main” or maybe decorating with @script_main now that we have decorators.
    • Blocks give me of ruby envy or smalltalk envy. I like local functions. Love them. I tolerate lambda. But I really, really would like to see a more rubyesque iterator setup where we pass a callable to the list, and the callable can be defined free-form inline. Python doesn’t really do that and so it’s less of a language lab than I might like.
    • Properties are unattractive, partly because of blocks being absent. I don’t really want to define a named parameter (with double-underscores, most likely) and then two named functions, and THEN declare a property. That seems like so much work for such a simple situation. It is something I will only do if all other methods fail me, or if all other methods are overriding __setattr__ and __getattr__.
    • Lack of recognition just kills me. This is a wonderful little language with great libraries and tremendous capability. Google, Eve, Nasa, a great many scientific efforts, a bunch of web sites, and a lot of Linux installers and configuration tools use python. A number of very nice distributed version control tools are written in it. But still people seem to go deaf if anyone mentions python, as if we’d mentioned JCL or something. I don’t get that.
    • There is a very ugly mutual-inclusion design bug bug. I spent time on it once and was very unhappy.
    • Self loathing takes over in my functions. I wish that I could refer to member variables without saying “self.” first. Testing would be easier if I could just import all my fixture variables into my local namespace—or better if it were done for me automagically. Typing “self.” doesn’t kill me, but it doesn’t help me. Yes, I have an abbreviation in my editor, but it still bugs me.

Don’t put me down as a complainer. I really, really love working in python. But There’s a lot more love than hate here.

PS: Is it uncommonly sensible that “not” is spelled “not”, “and” is spelled “and” and “or” is spelled “or”? I think so. && I’m ! just kidding || something.

Comments

Leave a response

  1. Avatar
    ewiethoff about 1 month later:
    >>> members = dir
    >>> members()
    ['__builtins__', '__doc__', '__name__', 'members', 
    'sys']
    >>> members(str)
    ['__add__', '__class__', '__contains__', 
    '__delattr__', '__eq__', '__ge__', '__getattribute__', 
    '__getitem__', '__getslice__', '__gt__', '__hash__', 
    '__init__', '__le__', '__len__', '__lt__', '__mul__', 
    '__ne__', '__new__', '__reduce__', '__repr__', 
    '__rmul__', '__setattr__', '__str__', 'capitalize', 
    'center', 'count', 'decode', 'encode', 'endswith', 
    'expandtabs', 'find', 'index', 'isalnum', 'isalpha', 
    'isdigit', 'islower', 'isspace', 'istitle', 'isupper', 
    'join', 'ljust', 'lower', 'lstrip', 'replace', 'rfind', 
    'rindex', 'rjust', 'rstrip', 'split', 'splitlines', 
    'startswith', 'strip', 'swapcase', 'title', 'translate', 
    'upper']
    
  2. Avatar
    Mike 2 months later:

    Python doesn’t lack recognition I think. As a Ruby guy I have to say that Python is way more widespread at the moment. And it is good for Python :-)

  3. Avatar
    hoffmann@cs.umass.edu 2 months later:

    self-loathing.

    Hmmm, I always just used ’s’ instead of ‘self’. For accessing fields it’s only one more character to type “s.field” than such typical C++/Java conventions as “aField” or “field_”. And starting every method declaration with “(s,” becomes second-nature.

  4. Avatar
    Matt 2 months later:

    Yeah, most of these tick me off. I don’t think Python 3000 is really going to address any of these, either.

  5. Avatar
    bag manufacturer over 3 years later:

    ility, the list comps, the generators, they way that I can get work done in Pyt

  6. Avatar
    Chicago mover over 3 years later:

    Yeah Mike came up with a valuable points.

  7. Avatar
    Rent Apartment Bucharest over 3 years later:

    My main disappointment with Python is that it is a dynamic language where types are objects and runtime instantiable but I’ve yet to see any guide to how this feature can be really utilized. The object system’s internal behavior is relatively poorly explained; e.g. if you look hard enough you’ll find that the rules for attribute lookup depend on data descriptors vs. non-data descriptors but not, say, why the rules depend on this or how this dependency can or should be used. Letting your code construct classes for you is pretty powerful.

    The lack of good guides is, I suppose, something of an opportunity as well. Regim Hotelier

  8. Avatar
    iPhone to Mac Transfer over 3 years later:

    The software you can trust to export iPhone music, video and more to Mac.

  9. Avatar
    Pandora over 3 years later:

    if you are not writing lots of automated test cases, and writing them before you write the code that makes them pass.

  10. Avatar
    mens nfl jerseys over 3 years later:

    The fortunate intelligence for people that take place to be superficial for negotiate – and aren’t all of us – could possibly be the simple fact that sixpenny Arizona cardinals NFL jerseys can certainly cheap nfl jerseys be treble attribute. They faculty be sturdy plus they won’t undo easy. They give human being all belonging for that recognizable qualities of substantially overpriced jerseys. The variations in between a tasteless discount women’s nfl jersey and an Football Jerseys high-priced just one lie inside the details and all belonging for that associated bells and whistles.The substantially high-priced youth nfl jerseys are exploit to acquire surplus qualities specified as stitched on lottery with wake less, multicolored artifact layers. mens nfl jerseys They are accomplishment to develop to be fashioned in sizes that mimic the sizes and styles used near to the theater plus they are accomplishment to human being all belonging for that small markings that leave piddle it relaxation out.All of <a href=”http://www.clothing-trading.com/”>Discount NFL Jerseysose components are major, but they are also essentially spare. should you essential to represent your lover squad or participant with affordable youth nfl jerseys online, you can perform so without any all of people design elements.

  11. Avatar
    Criminal Records over 4 years later:

    A number of very nice distributed version control tools are written in it. But still people seem to go deaf if anyone mentions python, as if we’d mentioned JCL or something. I don’t get that.

  12. Avatar
    Tenant Screening over 4 years later:

    Testing would be easier if I could just import all my fixture variables into my local namespace—or better if it were done for me automagically.

  13. Avatar
    Sunglass over 4 years later:

    At fashion-world4u you find Imitation Buy $10 Replica Designer Sunglasses with 3-day FREE SHIPPING At fashion-world4u you find Imitation

  14. Avatar
    cheap true religion los angeles over 4 years later:

    hni

    Method of washing and maintenance of True Religion Jeans for cheapjeans 1,
  15. Avatar
    jaychouchou over 4 years later:

    To be, or not to be- that is a question.Whether ipad bag tis nobler in the mind to suffer The slings and Game Controllers arrows of outrageous fortune Or to take arms against a sea of troubles, And USB Gadgets by opposing end them….....

  16. Avatar
    Kerry over 4 years later:

    I love this one. A very good post. Thank you. roof nokomis

  17. Avatar
    okey oyunu oyna over 4 years later:

    many thanks …

    internette görüntülü olarak okey oyunu oyna, gerçek kisilerle tanis, turnuva heyecanini yasa.

  18. Avatar
    real estate advertising over 4 years later:

    thank you for your post.. its really nice and i love it.

  19. Avatar
    Discount Sunglasses Outlet over 4 years later:

    Being the important carrier of Logos, science and technology have become the main content of human culture.

  20. Avatar
    mortgage brokers sunshine coast over 4 years later:

    I really prefer Python than PHP. It’s very powerful !

  21. Avatar
    p90x over 4 years later:

    These supplements and programs are almost like having a personal fitness trainer online. And while they can’t personally accompany you to the gym, this company can arm you with all the wisdom and knowledge you’ll need so you won’t be confused as to what to do when you get there. Just follow their guidelines.

  22. Avatar
    christian louboutin shoes on sale over 4 years later:

    These christian louboutin patent leather pumps are just the same as selling in the franchise store.Or even better.

  23. Avatar
    Great Depression over 4 years later:

    One of the thinks I like about this programming language is that it’s supported by a large company that uses it extensively – Google. This means that some intelligent people get paid to develop and improve Python. For example Guido Von Rossum, the Python creator, works on Python in Google. I heard that the “release manager” for Python 2.6 also works for Google. This is important: while enthusiasts can create great tools in their free time, my experience tells me that to really bring a tool to perfection, it is important for some people to earn their living from working on it. One other important fact is that the Python community doesn’t treat Windows as a platform without priority. All modules I’ve seen so far come with easy installers for Windows that just work. This is very important for me, as 95% of my work is being done on Windows.

  24. Avatar
    Jewellery over 4 years later:

    Online UK costume and fashion jewellery shop with, hg

  25. Avatar
    beats by dr dre headphones over 4 years later:

    Beats by dr dre studio with look after talk in white. extra attributes on Monster Beats By Dr. Dre Pro Headphones Black a specific tri-fold design and design and carrying circumstance which make for compact and uncomplicated safe-keeping when not in use. Beats by dr dre solo .

  26. Avatar
    pre bonded hair extensions over 4 years later:

    Your site is very beautiful. Your sharing even more beautiful. We expect to continue ..

  27. Avatar
    cookies gift baskets over 4 years later:

    hmm ,i’m not sure if this is what i’m looking for but anyway this is interresting and could be useful some day,thanks for taking time to write such cool stuff

  28. Avatar
    beats by dre store over 4 years later:

    be useful some day,thanks for taking time to write such cool stuffbeats by dre sale cheap beats by dre

  29. Avatar
    canada goose coat over 4 years later:

    Canada Goose Outlet is Marmot 8000M Parka. The Marmot 8000M Parka is really a waterproof, breathable jacket with 800 fill canada goose jacket feathers. It truly is design and light colored shell is produced for trendy, but uncomplicated, protection from cold temperatures. Reinforced shoulders, elbows and adjustable waist and hem make the Marmot a perfect alternate for skiing and other outdoor sports that want fairly a bit of arm motion. The 8000M Parka weighs three lbs., comes in bonfire and black colours and might be stuffed and stored like a sleeping bag to your convenience.This is one of well-know and prime down jacket brands.Hope our friends like its!Like canada goose womens and Canada Goose Expedition Parka.There are wholesale canada goose.

  30. Avatar
    Discount Gucci Sale over 4 years later:

    Thanks for this wonderful site. I really like the way you emphasized your point of view right here.I learned a lot and I obtain much knowledge upon reading this.

  31. Avatar
    ysbearing over 4 years later:

    Slewing bearing called slewing ring bearings, is a comprehensive load to bear a large bearing, can bear large axial, radial load and overturning moment.

  32. Avatar
    Tips For Bowling over 4 years later:

    Bottom up thinkers try to start from experience and move from experience to understanding. They don’t start with certain general principles they think beforehand are likely to be true; they just hope to find out what reality is like.

  33. Avatar
    alwadifa over 4 years later:

    that’s a very good article about java i helped me a lot

  34. Avatar
    christian louboutin over 4 years later:

    The professional design make you foot more comfortable. Even more tantalizing,this pattern make your legs look as long as you can,it will make you looked more attractive.Moveover,it has reasonable price.If you are a popular woman,do not miss it.

    Technical details of Christian Louboutin Velours Scrunch Suede Boots Coffee:

    Color: Coffee
    Material: Suede
    4(100mm) heel
    Signature red sole x

    Fashion, delicate, luxurious Christian louboutins shoes on sale, one of its series is Christian Louboutin Tall Boots, is urbanism collocation. This Christian louboutins shoes design makes people new and refreshing. Red soles shoes is personality, your charm will be wonderful performance.

  35. Avatar
    fashion brands over 4 years later:

    It’s useful to study your blog. I found so many entertaining stuff in your blog, especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the enjoyment here! Keep up the excellent work.

  36. Avatar
    backup iPhone sms over 5 years later:

    Well. Though I am not a good application developer. And I need do more hard work to improve myself. When I come to here. I know that I have come to the right place to learn something I need. Thanks for your good advice. And I will do the practice as possible as I can. Thanks.

  37. Avatar
    MPEG4 Converter over 5 years later:

    Straight to the point and well written! Why can’t everyone else be like this?, convert mpeg4 to mp4, avi, mpeg, wmv, flv, mp4, mov, divx, mp3, ps3, dvd

  38. Avatar
    louboutin sales over 5 years later:

    What I Don’t Like About Python 37 hoo,good article!!I like the post!33

  39. Avatar
    bladeless fans over 5 years later:

    What I Don’t Like About Python 38 good post159

  40. Avatar
    B.J. Raji Jersey over 5 years later:

    Coyotes Practice Jersey Ilya Bryzgalov Jersey Ray Whitney Jersey Ed Jovanovski Jersey Shane Doan Jersey Coyotes Jersey

  41. Avatar
    hermes graphite over 5 years later:

    There are certain behaviors that we can deal with, but when we start thinking that we may be going out of control, we could be dealing with an addiction?

Comments