Monday, 2021-02-08

*** tosky has quit IRC00:15
*** holser has joined #zuul00:22
*** holser has quit IRC01:21
*** rlandy has joined #zuul03:02
*** rlandy has quit IRC03:19
*** vishalmanchanda has joined #zuul03:59
*** ikhan has quit IRC04:04
*** ykarel|away has joined #zuul05:08
*** ykarel|away is now known as ykarel05:19
*** evrardjp has quit IRC05:33
*** evrardjp has joined #zuul05:33
*** jfoufas1 has joined #zuul05:46
*** ykarel_ has joined #zuul06:00
*** ykarel has quit IRC06:01
*** ykarel_ is now known as ykarel06:12
*** ykarel_ has joined #zuul06:27
*** ykarel has quit IRC06:28
*** ykarel_ is now known as ykarel06:45
*** ykarel has quit IRC07:08
*** ykarel has joined #zuul07:45
*** hashar has joined #zuul07:53
*** jcapitao has joined #zuul07:53
*** rpittau|afk is now known as rpittau08:00
*** holser has joined #zuul08:01
*** jpena|off is now known as jpena08:26
*** tosky has joined #zuul08:45
*** zbr is now known as zbr|pto08:45
*** phildawson has joined #zuul09:26
*** phildawson has quit IRC10:18
*** sshnaidm|afk is now known as sshnaidm10:21
*** nils has joined #zuul10:34
*** ikhan has joined #zuul11:36
*** jcapitao is now known as jcapitao_lunch11:39
*** rlandy has joined #zuul12:29
*** jpena is now known as jpena|lunch12:36
*** jcapitao_lunch is now known as jcapitao12:43
*** gouthamr has quit IRC13:26
*** guilhermesp has quit IRC13:27
*** aprice has quit IRC13:27
*** iamweswilson has quit IRC13:27
*** mwhahaha has quit IRC13:27
*** samccann has quit IRC13:27
*** gundalow has quit IRC13:27
*** johnsom has quit IRC13:27
*** gmann has quit IRC13:27
*** webknjaz has quit IRC13:27
*** vishalmanchanda has quit IRC13:27
*** stevthedev has quit IRC13:27
*** mnaser has quit IRC13:27
*** parallax has quit IRC13:27
*** dcastellani has quit IRC13:27
*** PrinzElvis has quit IRC13:27
*** samccann has joined #zuul13:28
*** guilhermesp has joined #zuul13:28
*** johnsom has joined #zuul13:28
*** mnaser has joined #zuul13:28
*** jpena|lunch is now known as jpena13:29
*** iamweswilson has joined #zuul13:29
*** webknjaz has joined #zuul13:29
*** sduthil has joined #zuul13:29
*** vishalmanchanda has joined #zuul13:30
*** gouthamr has joined #zuul13:30
*** gmann has joined #zuul13:31
*** parallax has joined #zuul13:31
*** aprice has joined #zuul13:32
*** stevthedev has joined #zuul13:34
*** mwhahaha has joined #zuul13:34
*** gundalow has joined #zuul13:34
*** dcastellani has joined #zuul13:45
*** PrinzElvis has joined #zuul13:51
*** rlandy is now known as rlandy|mtg14:18
*** rlandy|mtg is now known as rlandy14:45
*** hashar has quit IRC15:24
*** sshnaidm has quit IRC15:34
*** hashar has joined #zuul15:37
*** vishalmanchanda has quit IRC15:45
*** jpena is now known as jpena|brb15:46
*** jfoufas1 has quit IRC15:54
*** sshnaidm has joined #zuul15:58
*** jpena|brb is now known as jpena16:01
*** ykarel has quit IRC16:29
openstackgerritHelena Spease proposed zuul/zuul master: Errors from patch 3 added.  https://review.opendev.org/c/zuul/zuul/+/76940416:31
*** holser has quit IRC16:52
*** rpittau is now known as rpittau|afk17:05
*** jpena is now known as jpena|off18:00
*** hashar has quit IRC18:01
*** dcastellani has quit IRC18:25
*** webknjaz has quit IRC18:25
*** iamweswilson has quit IRC18:25
*** webknjaz has joined #zuul18:25
*** iamweswilson has joined #zuul18:26
*** dcastellani has joined #zuul18:26
*** nils has quit IRC18:29
*** jcapitao has quit IRC18:33
*** ianychoi_ has joined #zuul20:33
*** ianychoi has quit IRC20:37
*** smyers_ has joined #zuul20:59
*** smyers has quit IRC21:01
*** smyers_ is now known as smyers21:01
openstackgerritGuillaume Chauvel proposed zuul/zuul master: gitlab: Add access token name, Update docs, Fix webhook  https://review.opendev.org/c/zuul/zuul/+/77118421:10
*** tjgresha has joined #zuul22:10
tristanCfungi: it seems like pep634 (pattern matching) has been accepted today22:54
tristanCand here is an example of how it would work: https://www.python.org/dev/peps/pep-0636/#adding-a-ui-matching-objects22:56
mordredtristanC: thanks - that second thing was what I was just about to ask about22:58
tristanCmordred: you're welcome, notice how the example brings into scope the attributes that matched22:59
fungitristanC: very cool! so probably coming in 3.11?23:00
tristanCsuch pattern match is the feature i miss the most in python from haskell/ml23:00
mordredfascinating23:01
tristanCfungi: the announce says 3.1023:01
clarkbfun my firewall doesn't think I should talk to that23:02
clarkbI wonder if fastly got on its bad side23:02
tristanC(the announce is https://mail.python.org/archives/list/python-dev@python.org/message/SQC2FTLFV5A7DV7RCEAR2I2IKJKGK7W3/ )23:02
fungioh wow, that's soon... i'm already running 3.10.0a5 on my workstation23:02
*** parallax has quit IRC23:04
clarkbbut pypi is fine. I wonder if it could be fastly endpoint specific (and I'll stop bugging this channel with my ad blocking weirdness)23:04
*** mwhahaha has quit IRC23:04
*** mwhahaha has joined #zuul23:05
*** parallax has joined #zuul23:05
fungiinteresting to see they went with the proposal which looks like assignment but isn't23:05
corvusthat looks groovy23:12
corvus(it doesn't look *like* groovy, it looks groovy.  far out.  way cool.)23:12
corvushella tight23:13
mordredyeah - although when tristanC said matching it made me think about matching from rust rather than case statements. I like it though23:13
corvusi was almost literally writing that code last night23:15
corvusif key_event.scancode == KEY_HOME and key_event.keystate == key_event.key_up:23:15
clarkbthis is pattern matching like functional languages right?23:15
fungiclarkb: yep, exactly like functional languages (haskell inspired even)23:16
clarkbI'm in favor then :)23:16
corvus-> case KeyEvent(scancode=KEY_HOME, keystate=key_up):23:16
corvusso nice23:16
fungithe only thing that really sticks in my craw is the use of assignment-looking syntax for evaluation, which strikes me as unpythonic, but really that's fairly minor23:16
fungithe available operators are rather limited anyway23:17
tristanCmordred: it is similar to fp match, python uses `case pattern: expr` where rust or haskell would uses `pattern => expr`23:17
mordredyeah - my first read made me think it was creating singleton objects23:17
corvusfungi: does it help if you imagine the case statement is creating an imaginary KeyPress object for comparison with those values assigned to attributes?23:17
fungiit helps if i just have another pint23:17
mordredcorvus: no - that's the thing that tripped me up - that's what I thought it was doing23:18
mordredbut I've learned now so it's ok23:18
clarkbtristanC: does it do pattern matching of function args too?23:18
tristanCclarkb: what do you mean?23:18
clarkbtristanC: eg head x:xs = x type matching23:18
corvusmordred: i think logically you could think of it as kinda sorta doing that.  like, because i look at it that way, the assignment-lookingness of it actually makes it easier for me to understand.23:18
clarkbhead [] = nil23:18
mordredclarkb: you should check out https://www.python.org/dev/peps/pep-0636/#adding-a-ui-matching-objects23:18
clarkbmordred: ya I have to figure out why my firewall thinks its a bd idea to load www.python.org23:19
mordredhahahaha23:19
clarkbI suspect fastly did a bad and python.org is hitting the fallout23:19
fungiyour firewall is probably written in python and it's afraid you might try to rewrite it23:19
corvusclarkb: i can print it out and send you a copy by us mail23:19
fungiself-preservation at work23:19
clarkbcorvus: perfect :)23:19
mordredclarkb: http://paste.openstack.org/show/802449/23:19
tristanCclarkb: pattern seems to support list, e.g. `case [x, *xs]`23:20
clarkbI've got it subscribed to ad blocker lists as well as tracker lists. I suspect that fastly IPs got dinged for one or the other any I may need to go and make an exception rule for fastly ranges23:21
mordredtristanC: would case [x, *xs] be for if the match statement returned a list?23:21
mordredah - nevermind23:22
mordredI see the example23:22
mordredneat23:22
mordredyeah - this is nice23:22
mordredlike - it makes me want to bump the min to 3.10 :)23:23
corvusmordred, fungi: note also that there is local assignment of the variables that appear in the match statement (ie, key_name is available inside the case statement as a local)23:23
mordredyah - that part is super nice23:23
fungioh, yep, that does make it a bit more sensible then23:23
tristanCclarkb: the `:` operator in haskell is a type constructor, where list is defined as `data [] a = [] | a : [a]`, that is similar to an object constructor like `Click(position)`, which seems to be supported by the pep63423:26
clarkbya I was more curious if I could write python like this roughly: def foo(None): return None then def foo(1): echo "you gave me an int"; return None23:27
clarkbsounds like this is more about matching within functions though the matching there seems rich23:28
clarkb(I always liked the clear way the function definitions for different inputs help convey behavior in functional languages23:28
mordredyeah - this isn't multimethods23:28
tristanCclarkb: oh i see, no that is not part of this pep, perhaps in a future release? :)23:29
tristanCclarkb: though, I think you can always rewrite argument match to case expressions, there is even the LambdaCase extension to make this more ergonomic23:30
clarkbyes you should be able to, I just always liked the simplicity of that expression23:32
clarkbI think it makes for code that is easy to understand beacuse looking at the first line of a function tells you how it is likely to behave23:32
fungihonestly i've found the overloading of function names to be annoying in other languages23:33
tristanCclarkb: the issue is when you need to add a new argument, then all the top-level definitions needs to be changed, where it can be easier to do with the lambda case.23:33
fungii.e. having multiple definitions for the same function but taking different arguments23:33
clarkbfungi: I agree :) the difference here is you aren't really changing the argument types, you're just matching on their actual contents23:34
tristanCfungi: though in haskell, the arguments need to have the same type, it's not exactly overloading23:34
fungii tend to prefer if a particular function name can only ever be definied once within its scope23:34
clarkbit is different than say a C++ overload in that way23:34
fungiyeah, fair23:34
fungii also spent enough of my life hating on c++ for what it did to perfectly good c, but i've moved on and become a productive member of society since then23:35
tristanCthere is also erlang function arity which is quite usefuly, where you can define multiple functions with the same name, but with different number of arguments23:36
fungijava does something similar to that too23:36
clarkbfungi: its useful to show that you've handled corner cases and boundaries and express that in a quick way to epople reading the code23:37
fungialways seemed to me that having the same function name defined more than once made it harder to read the code rather than easier23:38
fungiyou can never be sure that the definition you found is the right one23:38
fungiwithout also looking at the types and number of arguments anyway23:39
clarkbthats the difference, they are all the right one in haskell because it does pattern matching on the input to determine which to call23:39
clarkbyou can even get more complicated and do boolean expressions on the matches23:40
clarkb(now I wonder if the python pep allows ^ too)23:41
tristanCclarkb: it does yes, that is called a pattern guard23:41
clarkbnice23:41
corvusthat's the "case KeyPress(key_name="Q") | Quit():" syntax?23:45
tristanCclarkb: the python pep also supports something that is missing from haskell as far as i know, that is to match multiple patterns in a single case expression using the `|` or combinator23:45
tristanCcorvus: that's the or combinator, the guard is implemented with the `if` keyword23:46
corvustristanC: ah i see that now, thx23:46
corvushttps://www.python.org/dev/peps/pep-0636/#adding-conditions-to-patterns23:47
*** ikhan has quit IRC23:56

Generated by irclog2html.py 2.17.2 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!