=== jmcgnh_ is now known as jmcgnh [17:15] 23.3.3 made it to -proposed for 20.04 and 22.04, but not 18.04. related to https://github.com/canonical/cloud-init/pull/1742/files i assume? [17:15] Pull 1742 in canonical/cloud-init "Ubuntu/bionic" [Open] [17:18] cjp256: correct, that httpretty commit is in upstream/main, but we have only pulled bugfixes for 22.3.3 into bionic-proposed [17:18] so https://github.com/canonical/cloud-init/commit/9aa4ec6982541f5425c860010fa87134e58469e6 is not in the -proposed release yet correct [17:18] Commit 9aa4ec6 in canonical/cloud-init "tests: Drop httpretty in favor of responses (#1720)" [17:19] it will be in 22.4 [17:19] which is in Nov [17:20] how do I split a line like this to fit into 80 char: [17:20] if toks[0].startswith("options=") or toks[0].startswith("ec_capabilities") or toks[0].startswith("ec_enabled"): [17:20] I guess i could use regex :O [17:21] that's one nice way. otherwise [17:21] if any([ [17:21] test1, [17:21] test2, [17:21] test3, [17:21] ]): [17:22] re.search(r"^(options|ec_capabilities|ec_enabled)=", toks[0]) [17:22] and was just staring on a regex :) [17:23] ship it [17:23] use if ( .. ) [17:23] regex is usually my first goto, but then i remember how awful that is to people who haven't done 22 years of Unix nonsense. [17:24] blackboxsw: so this doesn't need an or, that's nice [17:24] * blackboxsw wonders timeit cost of the multi-conditional if vs regex w/ "ORs" due to "|" [17:24] any([t1, t2, ...]) will evaluate all conditions first to build that array I think, so less effecient [17:24] yeah +1 cjp256 good pt [17:25] blackboxsw: regex done right can be really fast [17:25] I see so much regex out there that just makes me wanna cry [17:26] blackboxsw: how do you "timeit"? [17:27] meena: https://docs.python.org/3/library/timeit.html [17:27] create sample constructs or functions and shove them into it's own function or direct on commandline and see how it behaves vs alternatives across many iterations [17:28] gives you a quick relative comparison when you are looking at two ways of writing something [17:29] i wish i could feed it random data :D [17:29] basically, like, quickcheck, but timed. [17:38] meena: on that note, we're auto-formatting everything with black these days, so write it however you want and let black deal with it [18:02] falcojr: I should just integrate black into my emacs then [18:02] yes, I've integrated it into my editor...makes life a lot easier [18:08] i just forgot you had to add () around a long if line to make it make sense [18:08] but i reckon black would've handled that [21:27] blackboxsw: i'm not seeing an updated -proposed deb for 18.04, just the old build from 09/01 [21:27] cjp256: good pt. I'm not seeing it either. [21:28] thx cjp256 still stuck in unapproved queue, I think it was an oversight https://launchpad.net/ubuntu/bionic/+queue?queue_state=1&queue_text=cloud-init [21:29] thanks