Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • Apr 04 2021 12:26
    @dom96 banned @acroobat
  • Mar 03 2017 15:52
    @dom96 banned @Octopoda7
  • Feb 12 2017 23:57
    @dom96 banned @zzz125
  • Dec 23 2016 19:43
    @dom96 banned @Izrab
From IRC (bridge bot)
<FromDiscord> <Quibono> Is there a better way to insert something in the middle of a string than fmt?
<FromDiscord> <ElegantBeef> There are string templates
<FromDiscord> <nikki> @Quibono depends on what exactly you mean tbh
<FromDiscord> <nikki> if you have mostly literals on either side, that's different from inserting sth in the middle of a runtime string (say, something a variable is referring to)
<FromDiscord> <Quibono> So I've got a url "/v3/accounts/{accountid}/instruments"
<FromDiscord> <nikki> ah, this is actually a case to consider fmt
<FromDiscord> <nikki> i'd probably just use & myself bc. /shrug
<FromDiscord> <Quibono> Lol is either faster under the hood?
<FromDiscord> <nikki> like "/foo/" & thingy & "/bar"
<FromDiscord> <Quibono> like double & vs fmt
<FromDiscord> <ElegantBeef> Just use the proc i gave
<FromDiscord> <nikki> that proc decides based on the os you're running on, which is probably not what you want for urls
<FromDiscord> <ElegantBeef> Fuck windows
<FromDiscord> <nikki> better just write good code instead
<FromDiscord> <Quibono> lol
<Prestige> I agree, Beef
<FromDiscord> <nikki> @Quibono i can try out both and let you know on a bit, will just look at the generated C
<FromDiscord> <ElegantBeef> I'm saying fuck windows using \ as the default seperator
<FromDiscord> <nikki> i just think using the os module for concatenating urls is just bad coding
<FromDiscord> <nikki> because urls aren't about operating systems
<FromDiscord> <nikki> the format is a separate spec from file system path specs
From IRC (bridge bot)
<FromDiscord> <nikki> even though it looks like the character is the same
<FromDiscord> <ElegantBeef> I mean i didnt read url so...
<FromDiscord> <nikki> yeah "/v3/accounts/{accountId}/instruments" seems like a v classic url situation
<FromDiscord> <Quibono> Yeah it's a URL for a forex broker.
<FromDiscord> <nikki> is there urlutils or sth
<FromDiscord> <nikki> in any case, if it were to exist, that's what to use. otherwise, that's what to build up yourself or depend on. or just use & haha
<FromDiscord> <ElegantBeef> the uri module possibly
<FromDiscord> <nikki> @Quibono this is actually pretty spot on for what you wanna do
<FromDiscord> <Quibono> Cool, thanks.
From IRC (bridge bot)
<FromDiscord> <treeform> Why does strformat raise ValueError? Should I wrap all of my $ to not raise it? Is there a way to use strformat so that it does not do that?
<disruptek> concepts will let you down. stay away from them for now.
<FromDiscord> <treeform> @nikki I made this url library because I found current urls not sufficient https://github.com/treeform/urlly
<FromDiscord> <treeform> @Quibono So you want a url thing that can easily add paths to together? How do you think that should look like?
From IRC (bridge bot)
<FromDiscord> <Quibono> Honestly I just want something that looks pretty and is fast. 😮
<FromDiscord> <ElegantBeef> Treeform i noticed pixie doesnt end with a y, you have to legally change that
<FromDiscord> <treeform> Original name was pixxy
<FromDiscord> <treeform> but its to foreign looking
<FromDiscord> <treeform> pixie is a real word and sounds like its ends on a y
<FromDiscord> <treeform> so we went with a real word
From IRC (bridge bot)
<FromDiscord> <ElegantBeef> I forgive you
<FromDiscord> <treeform> thanks, means a lot.
<FromDiscord> <ElegantBeef> Well i did respect you, but now you lie to my face
<disruptek> get used to it.
From IRC (bridge bot)
<FromDiscord> <treeform> @ElegantBeef I am not laying to you, just playing along, cheer up!
<FromDiscord> <ElegantBeef> I was also joking around
<disruptek> not me.