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

1 line
8.0 KiB
JSON

[{"user_id": 8391, "stars": [], "topic_id": 9272, "date_created": 1298744692.4548841, "message": "I'm curious to know everyone's \"position\" concerning string formatting ('{}' vs '%' ).", "group_id": 292, "id": 215187}, {"user_id": 8391, "stars": [], "topic_id": 9272, "date_created": 1298744780.4459779, "message": "A while back, the vibe from the community seemed to be that %-style was frowned upon in general, and everything should be using {}", "group_id": 292, "id": 215191}, {"user_id": 9650, "stars": [], "topic_id": 9272, "date_created": 1298745941.868773, "message": "Won't % be going away some day?", "group_id": 292, "id": 215233}, {"user_id": 8391, "stars": [], "topic_id": 9272, "date_created": 1298744837.2752731, "message": "I'm not sure that's the vibe anymore. Is it? Discuss.", "group_id": 292, "id": 215196}, {"user_id": 7, "stars": [], "topic_id": 9272, "date_created": 1298745110.86535, "message": "I prefer {}, but since most of the code I write has to support older pythons I can't erally move yet", "group_id": 292, "id": 215210}, {"user_id": 12791, "stars": [], "topic_id": 9272, "date_created": 1298745841.7233429, "message": "I've always used {}, so I never bothered to learn: is there any capability or technical difference, or is it just syntactic??", "group_id": 292, "id": 215230}, {"user_id": 9650, "stars": [], "topic_id": 9272, "date_created": 1298746085.069576, "message": "@zuwiki {} can access attributes and items of the passed objects.", "group_id": 292, "id": 215235}, {"user_id": 5639, "stars": [{"date_created": 1298751052.263556, "user_id": 15292}, {"date_created": 1298934783.0064039, "user_id": 13524}], "topic_id": 9272, "date_created": 1298746636.9098351, "message": "@zuwiki there's much more power in the new-style formatting as compared to '%'. http://docs.python.org/py3k/library/string.html#format-examples", "group_id": 292, "id": 215249}, {"user_id": 12791, "stars": [], "topic_id": 9272, "date_created": 1298747349.8084431, "message": "@bronger @jonesy I was suspicious that might be the case. Well, that' settles the issue for me, haha.", "group_id": 292, "id": 215273}, {"user_id": 1152, "stars": [{"date_created": 1298786888.1870871, "user_id": 11592}, {"date_created": 1298911076.883188, "user_id": 1243}], "topic_id": 9272, "date_created": 1298750921.439693, "message": "I hated the new {} format at first, but it's grown on me more and more", "group_id": 292, "id": 215419}, {"user_id": 7, "stars": [], "topic_id": 9272, "date_created": 1298751052.383558, "message": "@jessenoller I really love it when I have places that users pass in a string and I format it, before I'd have to pass random attributes that the user might want, now I can just provide the obj and they can access the attrs", "group_id": 292, "id": 215429}, {"user_id": 1152, "stars": [], "topic_id": 9272, "date_created": 1298751361.773633, "message": "@alex Exactly", "group_id": 292, "id": 215460}, {"user_id": 1289, "stars": [{"date_created": 1298751908.93152, "user_id": 7}, {"date_created": 1298765838.8335099, "user_id": 8391}, {"date_created": 1298771936.194571, "user_id": 214}, {"date_created": 1298785284.413537, "user_id": 4156}, {"date_created": 1298982456.50598, "user_id": 927}, {"date_created": 1299450589.5006011, "user_id": 16590}], "topic_id": 9272, "date_created": 1298751574.3347099, "message": "I feel like the Dos Equis guy. \"I don't always format strings, but when I do, I choose brackets.\"", "group_id": 292, "id": 215470}, {"user_id": 2863, "stars": [], "topic_id": 9272, "date_created": 1298784395.9155121, "message": "Been using {} since Python 3 was released and I have gladly not looked back", "group_id": 292, "id": 216580}, {"user_id": 3354, "stars": [{"date_created": 1298839328.2150929, "user_id": 8391}], "topic_id": 9272, "date_created": 1298830599.276515, "message": "Benchmarking indicates that the new mechanism is somewhat slower than the old (for those things they can both do comparably). Personally this doesn't bother me enough t make me hold ont he old mechanism, but YMMV", "group_id": 292, "id": 218786}, {"user_id": 15977, "stars": [{"date_created": 1298839358.9877651, "user_id": 8391}], "topic_id": 9272, "date_created": 1298834569.833226, "message": "I never really liked the {} style in C# either", "group_id": 292, "id": 219688}, {"user_id": 15977, "stars": [], "topic_id": 9272, "date_created": 1298834579.990643, "message": "but for more complex formatting it is definitely good", "group_id": 292, "id": 219691}, {"user_id": 15977, "stars": [], "topic_id": 9272, "date_created": 1298834561.524416, "message": "I still prefer the %s style for simple formatting", "group_id": 292, "id": 219681}, {"user_id": 9229, "stars": [{"date_created": 1298852253.2726531, "user_id": 8391}], "topic_id": 9272, "date_created": 1298849842.7700689, "message": "% for simple formatting by far - but that could just be because I've not used the new formatting enough. I recently wrote format(\"some text\", ' ^%s' % width) which I'm pretty sure can be written better in new formatting. Mostly I just prefer % because .format() is so much longer than % :-)", "group_id": 292, "id": 222488}, {"user_id": 9229, "stars": [], "topic_id": 9272, "date_created": 1298850080.6262989, "message": "Indeed I've just re-read the format docs and format(\"some text\", ' ^%s' % width) may be re-written as '{:^{}}'.format(\"some text\", width). Remembering that might be a challenge.", "group_id": 292, "id": 222558}, {"user_id": 3354, "stars": [], "topic_id": 9272, "date_created": 1298957113.5806961, "message": "It's actually not at all difficult to oick up.", "group_id": 292, "id": 232030}, {"user_id": 3354, "stars": [], "topic_id": 9272, "date_created": 1298957119.1994481, "message": "pick up, I meants", "group_id": 292, "id": 232031}, {"user_id": 12791, "stars": [], "topic_id": 9272, "date_created": 1298962377.4933071, "message": "Yeah, .format() instead of % is unfortunate.", "group_id": 292, "id": 232528}, {"user_id": 7, "stars": [], "topic_id": 9272, "date_created": 1298962750.9090941, "message": "One nice thing is it reduces the awkward line continuation problem you sometimes face :)", "group_id": 292, "id": 232574}, {"user_id": 1944, "stars": [{"date_created": 1299503817.8836019, "user_id": 2313}], "topic_id": 9272, "date_created": 1298980180.4314809, "message": ".format() is much more sensible=pythonic", "group_id": 292, "id": 233901}, {"user_id": 9229, "stars": [], "topic_id": 9272, "date_created": 1299028005.8440731, "message": "sorry @dag, but to me, after almost 15 years, % is pythonic :-)", "group_id": 292, "id": 242382}, {"user_id": 1376, "stars": [], "topic_id": 9272, "date_created": 1299082804.008302, "message": "But then again, I came into Python after many years of being abused by Perl, so that may be an unfortunate side effect.", "group_id": 292, "id": 248340}, {"user_id": 1376, "stars": [{"date_created": 1299357014.6581471, "user_id": 8391}], "topic_id": 9272, "date_created": 1299082759.621176, "message": "I like % over .format, mainly because it's shorter.", "group_id": 292, "id": 248336}, {"user_id": 3354, "stars": [], "topic_id": 9272, "date_created": 1299449084.0293369, "message": "The advantages of format() include the ability to access attributes and items of parameters by specifying it in the format string - you don't have to pass the different attributes or items.", "group_id": 292, "id": 282011}, {"user_id": 8699, "stars": [], "topic_id": 9272, "date_created": 1299450237.0622151, "message": "If you are building a large string then format() makes it easier to read with its with {n} placeholders.", "group_id": 292, "id": 282116}, {"user_id": 8699, "stars": [], "topic_id": 9272, "date_created": 1299450449.40488, "message": "Also with format(), the arguments can be accessed more than once without having to repeat them. eg: \"{0} Discussions about the {0} programming language.\".format('Python')", "group_id": 292, "id": 282130}, {"user_id": 15977, "stars": [], "topic_id": 9272, "date_created": 1299455271.0338011, "message": "@rakshitpai yeah, being able repeat positional entries is nice.", "group_id": 292, "id": 282395}]