Files
2012-02-21 01:15:00 -05:00

1 line
5.2 KiB
JSON

[{"user_id": 1736, "stars": [], "topic_id": 21854, "date_created": 1304021714.8978601, "message": "(__slots__ will throw it off, for example)", "group_id": 292, "id": 846639}, {"user_id": 1736, "stars": [], "topic_id": 21854, "date_created": 1304021683.6910281, "message": "you get the idea", "group_id": 292, "id": 846630}, {"user_id": 1736, "stars": [], "topic_id": 21854, "date_created": 1304021681.0513361, "message": "Ack, formatting doesn't work unless you really paste it", "group_id": 292, "id": 846629}, {"user_id": 27202, "stars": [], "topic_id": 21854, "date_created": 1304020421.928441, "message": "I want to do something like :", "group_id": 292, "id": 846437}, {"user_id": 1736, "stars": [], "topic_id": 21854, "date_created": 1304021742.531348, "message": "A more portable solution is for name in dir(obj): value = getattr(obj, name) .....", "group_id": 292, "id": 846644}, {"user_id": 27202, "stars": [], "topic_id": 21854, "date_created": 1304021839.233568, "message": "I'm gonna try this out, thx for the tips ;-)", "group_id": 292, "id": 846665}, {"user_id": 27202, "stars": [], "topic_id": 21854, "date_created": 1304020448.356534, "message": "items = cri.__class__.__dict__\n for item in items:\n if isinstance(items[item],types.FunctionType):\n #execute the function with one parameter", "group_id": 292, "id": 846443}, {"user_id": 257, "stars": [], "topic_id": 21854, "date_created": 1304021863.470315, "message": "or vars(obj) instead of obj.__dict__?", "group_id": 292, "id": 846671}, {"user_id": 1736, "stars": [], "topic_id": 21854, "date_created": 1304021668.2772541, "message": "for name, value in obj.__dict__.iteritems():\n if isinstance(value, FunctionType):\n value(12345)", "group_id": 292, "id": 846628}, {"user_id": 1736, "stars": [{"date_created": 1304077614.0941, "user_id": 20326}], "topic_id": 21854, "date_created": 1304021701.2800009, "message": "This won't work everywhere though, and shouldn't generally be used in Real Code", "group_id": 292, "id": 846634}, {"user_id": 1736, "stars": [], "topic_id": 21854, "date_created": 1304021749.4383979, "message": "But still, not usually a great idea", "group_id": 292, "id": 846646}, {"user_id": 257, "stars": [], "topic_id": 21854, "date_created": 1304021939.862093, "message": "doesn't help for __slots__ though", "group_id": 292, "id": 846693}, {"user_id": 27202, "stars": [], "topic_id": 21854, "date_created": 1304021974.2244129, "message": "in fact I want to call all MY implemented methods of my object", "group_id": 292, "id": 846702}, {"user_id": 1736, "stars": [], "topic_id": 21854, "date_created": 1304022409.4335229, "message": "@asksol Yeah, AFAIK only dir() groks __slots__", "group_id": 292, "id": 846833}, {"user_id": 257, "stars": [], "topic_id": 21854, "date_created": 1304022116.481333, "message": "guess vars() doesn't really provide anything useful, just often seen it used. I must say the iterator version makes sense", "group_id": 292, "id": 846743}, {"user_id": 27202, "stars": [], "topic_id": 21854, "date_created": 1304023292.461566, "message": "thx for the help (it is the first time I use convore btw, and am very happy to see qualified and fast people in it:-)", "group_id": 292, "id": 847009}, {"user_id": 27202, "stars": [], "topic_id": 21854, "date_created": 1304023220.5453711, "message": "it seams working, but then i will get __doc__ and __module__ with dir()\ni passed it with : if isinstance(cri.__class__.__dict__[name], types.FunctionType):", "group_id": 292, "id": 846993}, {"user_id": 1736, "stars": [{"date_created": 1304077628.2091169, "user_id": 20326}, {"date_created": 1304101821.9698679, "user_id": 1243}], "topic_id": 21854, "date_created": 1304023966.010556, "message": "To repeat, you should only ever do things like this for interactive debugging. If you are considering using this in Real Code, you are 99% likely doing something wrong and should ask more questions.", "group_id": 292, "id": 847149}, {"user_id": 27202, "stars": [], "topic_id": 21854, "date_created": 1304024096.703032, "message": "yes this is just for debuging ;-) ( lazy debuging, i admit )", "group_id": 292, "id": 847182}, {"user_id": 27289, "stars": [{"date_created": 1304101584.158577, "user_id": 1}, {"date_created": 1304101833.8147631, "user_id": 1736}, {"date_created": 1304155854.4643941, "user_id": 11592}], "topic_id": 21854, "date_created": 1304087777.17137, "message": "Using inspect.getmembers with a predicate like inspect.ismethod is the cleanest way to do this for more production code, though for quick and dirty debugging dir() is pretty handy.", "group_id": 292, "id": 857069}, {"user_id": 1917, "stars": [], "topic_id": 21854, "date_created": 1304094340.7376499, "message": "you can do ur_object??", "group_id": 292, "id": 859321}, {"user_id": 1917, "stars": [], "topic_id": 21854, "date_created": 1304094336.2262111, "message": "using iPython", "group_id": 292, "id": 859318}, {"user_id": 1917, "stars": [], "topic_id": 21854, "date_created": 1304094349.413343, "message": "which lists all methods", "group_id": 292, "id": 859323}, {"user_id": 1, "stars": [], "topic_id": 21854, "date_created": 1304101598.7621911, "message": "@mattgood that's a good one, I hadn't heard of inspect.getmembers before", "group_id": 292, "id": 860851}]