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

I'd say that's possibly a not so interesting comparison, in the sense that python and clojure seem to have quite different name-usage patterns, but some values that may interest you: the size of __builtins_, the basic types and functions would be

    len(__builtins__.__dict__.values()) #=> 143
but then you'd have to consider the methods/attributes on each object

    len(list(chain( *[dir(o) for o in __builtins__.__dict__.values()]))) #=> 4133
but then again, most of these are either the same method that keeps appearing via inheritance, or a different implementation of the same protocol, so you may want to collapse same-named objects

    len(set(chain( *[dir(o) for o in __builtins__.__dict__.values()]))) #=> 250

which added to the names of the first iteration gives you ~400 names, about half of clojure.

But a lot of code in python is in the standard lib even if not loaded as __builtin__, sadly, I'm not sure how to list/load all the standard library in one go.



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

Search: