5 ms·
I was writing some Python code (not my primary language), and wanted to know if there was something built into f-strings that would nicely wordwrap the output.
by 1024core 3y ago
I was writing some Python code (not my primary language), and wanted to know if there was something built into f-strings that would nicely wordwrap the output.
I did a Google search for "how can I create f-strings in python so the output is wrapped at some fixed length". Except, for Google, I did not use the "how do I" etc. and just threw some keywords at it: "python f-string wrapping", "python f-string folding", etc.
All I got back was various results on how to wrap f-strings themselves.
Frustrated, I typed "how can I create f-strings in python so the output is wrapped at some fixed length" into ChatGPT, and back came the answer: ... However, f-strings themselves don't provide a built-in method for wrapping text at a specific width. ... For text wrapping, you can use the textwrap module ... Here's how you can combine f-strings with the textwrap module to achieve text wrapping: ... (followed by a full example).
I think "Search" will be changing dramatically over the next year or two. And websites which depend on Search traffic to survive will be in deep trouble.
- jeffbee 3y agoThe double standard here is hilarious. The ChatGPT result you got is better largely because you typed in a longer search doc. The illusion of superiority that surrounds ChatGPT is significantly due to the human factors curiosity that people are willing to type in a long-ass search string in the conversational context. They will type "best pants" into Google then complain about the futility of it, then switch tabs and spend ten minutes writing a short essay on pants for ChatGPT, and rave about the results. If you take the entire quoted search sentence from your third paragraph, then Google also presents a complete solution.
- slifin 3y agoI feel like Google has trained this behaviour into its long time users Previously writing human like sentences would not yield good results Now its more like <key word> <key word> reddit
- hparadiz 3y agoGoogle and the companies that litter the results page only have themselves to blame. When I was trying to find some boiler plate for pulling something from AWS parameter store I got total nonsense docs that weren't even what I wanted but it was mostly AWS docs or online tech diploma mill nonsense. Then I used chatgpt and it did 90% of the work in 20 seconds. Sometimes Google should just show me the code on GitHub but instead Google wastes my time.
- janoc 3y agoBut think the amount of ads (err "sponsored results") you got to see and click on! This is by design.
- jgalt212 3y agotruth. I formulate Google queries like phrases in a hypothetical document I hope exists.
- efilife 3y agoits* https://youryoure.com/?its https://youryoure.com/?its
- anon373839 3y agoGoogle used to do keyword based search only; now, it’s a hybrid of keywords and semantics, and they seem to be upweighting the latter more and more. This can be good if you don’t care about precision (“pasta recipes” -> “penne alla vodka”), but frustrating if you know exactly what you are wanting to match.
- bonki 3y ago100% this.
- danaris 3y agoI...think you may be misreading them? They said that they put exactly the same queries into Google as ChatGPT.
- zamadatix 3y agoThe way GP worded it is a bit confusing and ambiguous but it doesn't seem like they typed the same question into both, rather they typed what they thought each wanted to know about the same question. In one sentence they say they typed an exact quote into Google but in the very next sentence they clarify they actually typed a bunch of keywords about that quote instead.
- edave64 3y agoI believe they mean that's how Google interpreted the query?
- theptip 3y ago> Except, for Google, I did not use the "how do I" etc. and just threw some keywords at it: "python f-string wrapping", "python f-string folding", etc.
- 1024core 3y agoHere's the thing. For the longest time (since circa 1999) I've been a Google user. Google trained me to not use superfluous words like "how do I .... " etc. Just put down the keywords, and spare me the babble, Google said. With LLMs, on the other hand, it feels like I'm dealing with a human being on the other end: so I have to add stuff like "how can I"... and "please" and "thank you" (and sometimes "no yapping" ;-D ). So I queried Google just like I normally do.
- dataflow 3y ago> If you take the entire quoted search sentence from your third paragraph, then Google also presents a complete solution. Which one is the complete solution you're seeing here? https://www.google.com/search?q=how+can+I+create+f-strings+in+python+so+the+output+is+wrapped+at+some+fixed+length https://www.google.com/search?q=how+can+I+create+f-strings+i...
- jvolkman 3y agoGoogle generated an answer for me. https://photos.app.goo.gl/2gvMEMxszs1R5rWMA https://photos.app.goo.gl/2gvMEMxszs1R5rWMA
- dataflow 3y agoOh cool! Thanks for the screenshot.
- heisenzombie 3y agoI mean, that’s just completely wrong though! (1) It attempts to wrap and then substitute, which is nonsense (2) it doesn’t even expand the string you give it! That f-string in there is basically a no-op and (3) it truncates to only the first line, and throws away the rest.
- edgyquant 3y agoI had an answer similar to chstgpts that was generated as the first result.
- partiallypro 3y ago> I think "Search" will be changing dramatically over the next year or two. And websites which depend on Search traffic to survive will be in deep trouble. Yes, and no. A lot of sites generate crap content as it is. Not all search queries are just questions that can be answered, some are looking for businesses, shopping items, legal help, etc things that ChatGPT, etc can't emulate. AI will hurt sites like Reddit/StackOverflow/Quora, etc which answer -actual- questions. The issue is that once that happens there will be less and less content to solve random issues and ChatGPT, etc will not have been trained on them creating a bit of a gap. Then couple that with all the junk AI articles people will be publishing, it will be increasingly more difficult to solve minor issues that you randomly come across. ChatGPT/Midjourney, etc right now is just feeding into the "Dead Internet." I'd say currently, on net, it has been more of a bad thing than a good thing. That may change, or it could get worse.
- vineyardmike 3y ago> some are looking for businesses, shopping items, legal help, etc things that ChatGPT, etc can't emulate. Except it can. It doesn’t have to try and “remember” the details in its weights, it can RAG and all sorts of fun tricks. As Google’s Search Generative Experience shows, LLM interfaces don’t have to be strictly chat. These tools surface and aggregate existing content, instead of hallucinating new ones. It can’t stop people from pasting generated content into Reddit, but it can be used for actual search. Imagine just asking ChatGPT (or more likely, Gemini) for “space heater recommendations for a 300sqft office in a shed” and having the LLM walk you through the options - you no longer need to use a UI to toggle filters, and you don’t need to explicitly throw keywords into a search bar and hope you picked the right ones. Regarding the “dead internet” - you’ll always have humans create new content. People wanna talk about their interests on Reddit. That won’t change. People will file bug reports and new code in GitHub. Companies will post support articles. Journals will publish research papers. These “good” sources will still exist because there are external reasons to. The only thing that will die are the SEO crap now that they’re really not special.
- yashasolutions 3y agoAs a side note, "Search" outside of google is changing too. I have been using Kagi for a few month now, my search experience is so much better since then.