« first day (2006 days earlier)      last day (2939 days later) » 

7:02 PM
if x==True:
    return True
else:
    return False
I like that ^ (ref)
 
Feb 11 at 15:28, by Kevin
>>> x = True
>>> "ftarlusee"[x::2]
'true'
>>> x = False
>>> "ftarlusee"[x::2]
'false'
I'm in the mood for shameless self-promotion today.
 
I remember that. That was the best
 
I love repwhores who don't even read the question and get downvoted a lot
 
7:07 PM
Lol (cc @wim) (2 up)
 
I wish 8, was a single element tuple. :/
 
@Morgan'Venti'Thrappuccino: It is.
 
Hi @user2357112
 
@BhargavRao: Yo.
 
Well, depends on context. Sometimes naked commas confuse the parser.
 
7:13 PM
Do you recognize 2 3 5 7 11?
 
That's weird, because this made me think otherwise.
>>> type(8,)
<class 'int'>
>>> type((8,))
<class 'tuple'>
>>> x = 8,
>>> type(x)
<class 'tuple'>
But it would appear I was wrong. :P
 
Yeah, trailing commas in a callable's argument list get ignored.
 
Turns out type thought I was passing an extra param. :P
 
@Morgan'Venti'Thrappuccino: The comma in type(8,) is considered a function argument separator. You can have a trailing one of those without an argument after it.
 
Yeah, that was my confusion.
 
7:14 PM
@BhargavRao: Yeah, that's why I kept this name.
 
Ignoring trailing commas is a useful feature in many cases but produces some seemingly inconsistent behavior here. Such is life.
 
7:25 PM
Is there any official documentation on Python's attribute lookup process? I just wrote an answer that refers to this list, which looks correct, but I'd prefer something that lives on docs.python.org.
 
wim
@BhargavRao yah i got pwned
 
The post in particular is Unexpected name lookup on properties. OP's curious about why obj.__dict__["foo"] = thing doesn't change the behavior of obj.foo when obj's class has a foo property.
 
wim
your name[:-1] is better
 
@wim "user2357112"[4:-1] :|
 
wim
7:32 PM
fun fact in python2
>>> def foo(x, y=1, **kwargs,):
...     pass
  File "<ipython-input-1-396d5d2b49a1>", line 1
    def foo(x, y=1, **kwargs,):
                            ^
SyntaxError: invalid syntax
 
I return from badminton
 
I think vaultah found what I was looking for. From the descriptors documentation, "If an instance’s dictionary has an entry with the same name as a data descriptor, the data descriptor takes precedence."
 
@Ffisegydd stop making me jealous
 
wim
Hmm actually it persists in python3.5.0 too. I thought that was fixed
 
IIRC it was fixed in Python 3.6
 
7:33 PM
"fixed"
 
@Programmer Noooooooo
 
9
Q: SyntaxError with passing **kwargs and trailing comma

Niklas RI wonder why this is a SyntaxError in Python 3.4: some_function( filename = "foobar.c", **kwargs, ) It works when removing the trailing comma after **kwargs.

 
wim
3.6 isn't out yet :)
why is poke's answer CW ?
 
Somehow allowing trailing commas in def statements seems less useful to me than allowing them in function call argument lists.
Maybe that's just my personal bias. I only find trailing commas useful when the list is multiple lines long, and I never ever have multiline defs.
 
wim
if you are an asshole and you use the retarded type-hinting feature you might want multiline defs
def foo(*args):
    print args
what should foo(8,) print?
 
Just realised I missed the room meeting :(
 
wim
see, you are already confused ... ;)
 
@JRichardSnape you and me, both
 
@wim It should print SyntaxError: Missing parentheses in call to 'print'
3
^ that one's for you @antti
 
@JRichardSnape nice
 
7:42 PM
Hey @Morgan'Venti'Thrappuccino: if you're super happy, do you describe yourself as Ventilated?
 
@inspectorG4dget (ಠ_ಠ)
 
Weak.
 
Nah, he just becomes Morgan'Trenta'Thrappuccino
 
@tzaman ( ͡° ͜ʖ ͡°)
 
"trenta"? I cannot find that in the dictionary
 
7:44 PM
Have you not been inculcated in the Church of Starbucks?
 
yes. But I'm aware only of tall, grande, and venti... not trenta
so I guess I'm not one of the high priests
 
It's their 31oz cup. AKA way too much Starbucks.
 
hahaha
 
how does it even stay hot when it's that big
 
To be fair, I feel that way about any amount of Starbucks.
 
7:46 PM
We don't have that in GB.
 
@idjaw It's for cold drinks.
 
I feel like this is where I need that Denis Leary skit
 
You need to be Operating Thetan level 8+ to get trentas.
 
How much is 31oz in real money?
 
so I was saying earlier that there were too many crime dramas that took place in boston, and today, I walked past the filming for ANOTHER boston crime drama movie in South Boston
 
7:46 PM
Oh wait, that's Scientology, not Starbucks.
 
@Ffisegydd 1.3Kilostone.
 
@corvid CSI - Boston?
 
@Morgan'Venti'Thrappuccino reminds me of how some people feel about math
 
@inspectorG4dget I'll have to show that to the GF, she'll appreciate it.
 
does she wear hats? then she's not an alien
 
7:51 PM
@inspectorG4dget Not usually, no. And she's definitely an alien.
 
>>> n = 4
>>> word = "Wow"
>>> symb = "!"
>>> print("\n".join(map(lambda x:x[0]+x[1],zip([word]*(n-1),map(lambda i:symb*i,range(1,n))))))
Wow!
Wow!!
Wow!!!
Trying not to use for keyword
 
are we reverse-golfing that one now?
 
@inspectorG4dget my missus was not impressed:P
 
@BhargavRao that looks like so much like lisp. Your python is very lispy
@AndrasDeak but but but Orras is a mathgirl. That image was meant for muggles (so, not her)
 
7:56 PM
@inspectorG4dget Need more brackets?
 
yeah, I figured:D
 
@BhargavRao for the lambdas, perhaps. Python works around the necessity for parens with the use of : and whitespace
 
It's like when I see jokes about spherical cows in a vacuum. I keep waiting, but the joke never comes.
 
user559633
that's what she said
 
7:57 PM
isn't that because sound (and therefore speech) doesn't travel in a vaccum?
 
Answering after 2 weeks
 
@BhargavRao just for fun:
print("\n".join(map(lambda x:"{}{}".format(*x),zip([word]*(n-1),map(lambda i:symb*i,range(1,n))))))
 
Lol, Better
Still not long enough to wrap around
 
@inspectorG4dget why lambda x:"{}{}".format(*x) Why not ''.join?
 
I suggest a simple recursive solution:P
 
8:00 PM
@Morgan'Venti'Thrappuccino output o/p of zip.
 
print("\n".join(map(''.join,zip([word]*(n-1),map(lambda i:symb*i,range(1,n)))))).
Wow!
Wow!!
Wow!!!
 
@Morgan'Venti'Thrappuccino Because I'm stupid
 
@Morgan'Venti'Thrappuccino Ah that.
Got confused there
Nice trick avoiding the for keyword! OP should be aware there is still a loop there, in [word]*(n-1)zmbq 2 mins ago
 
@BhargavRao itertools.cycle([word]) might get around that, if only because [word] has only one element
 
wim
whats better salt vs ansible ?
 
8:05 PM
I can answer salt vs pepper tho :(
@inspectorG4dget trying that now
 
salt makes things taste better, and keeps them from going bad. So that's my vote
 
An ansible communicates faster than the speed of light though, so that's a point in its favor.
 
@BhargavRao itertools.repeat(word) definitely gets around that (the implementation uses a while True <- not a for)
 
@inspectorG4dget still a loop :/
 
> Trying not to use for keyword
 
8:09 PM
You make me add, trying not to use for and while
 
@inspectorG4dget except anise-based sweets
 
user559633
ansible is whatever
 
*looking at you, salmiakki*
 
user559633
which is what you'd want from a config management setup
 
user559633
it's redhat owned now and they don't shy away from non-backwards compat changes almost on a whim
 
8:12 PM
@AndrasDeak touche! And now I want candy...
 
There is a request to synonymize Py2.5 to Py2.x
 
I've never used salt. I can speak of ansible and puppet. Both were easy to grasp and Vagrant plays nice with them.
 
user559633
used salt
 
But I think Vagrant plays nice with salt too
 
user559633
wahtever it's config management don't overthink it
 
8:16 PM
That's why I like salt - it's very straightforward ;)
(and they do try to stay backwards compatible as much as possible)
 
user559633
i like turtles
 
Silly. turtles is not a config management....
pffffft
 
turtles is a language
 
wim
puppet is horrible
there is no competition there
 
user559633
turtle.write("Pffffff")
 
wim
8:19 PM
I have more experience with ansible than salt, but so far salt seems better and faster
 
I like turtles too... but mostly when they're teenagers, and mutants... and ninjas
3
 
(at 6:30 is where some interesting things start happening)
 
downvoteable
@BhargavRao I downvoted them both
 
(okay maybe 9 minutes in...)
 
8:22 PM
I think I've heard that as a negative on some blog posts...
 
@AnttiHaapala Thanks, It's gone
 
user559633
@wim that's just mdehaan (who wrote the original version) and no longer is on the project
 
I've always had fine interactions both on the Salt GitHub and #salt on freenode
 
user559633
it's owned by redhat now fwiw
 
3 points away from [string] silver
 
8:25 PM
@wim sounds like the attitude I've met with requests and lately among cpython coredevs.
 
Here's the post I was thinking of: ryandlane.com/blog/2014/08/04/…
If you read his "responsiveness" section (i.e. community responsiveness)
> When I linked to the POSIX spec showing why it was a bug the issue wasn’t reopened and I was told I could submit a patch.
(that was Ansible)
> All of these bugs, except for the listen/listen_in feature could have easily been worked around, but I felt confident that if I submitted an issue the bug would get fixed, or I’d be given a reasonable workaround. When I submitted issues I was usually thanked for the issue submission and I got confirmation on whether or not my issue was approved to be fixed or not.
 
@WayneWerner that is a so-so...
 
Of course that was nearly 2 years ago now... but, FWIW.
 
the end-of-file. A text file in posix must have "\n" but who says they're all text files
 
Probably Ansible documentation? Especially if (I'm assuming, since I don't know Ansible) you're copying text from your config into a file, it's gonna be text. I mean... storing binary files in your config sounds like trouble
 
user559633
8:31 PM
ehh files shouldn't have a ... antti got it
 
user559633
i remember that one; i think i was in IRC at the time
 
@WayneWerner with that I guess you can use any 8-bit strings with escapes
 
ugh. Starting an ssh session and forgetting to type in my key passphrase while I go get distracted by something else so I have to come back and reconnect is the worst
 
rhubarb
Time to sleep
 
8:45 PM
How do I get the original filename in Flask after I upload a file to an endpoint
for f in request.files:
received_file_name = str(f)
 
Technically it's not the original filename, just whatever the browser tells you the filename is, mind
(which was the second result when I duck duck went for 'flask file upload filename')
it's probably request.files[f].filename, unless there's some overloading happening
 
9:13 PM
woah a Barenaked Ladies song.
wow...haven't heard those guys in forever
 
BNL is one of my favorites
I loved learning the bizarre lyrics to "One Week"
And I was quite delighted by the line in "Pinch Me"
> I could hide out under there/I just made you say underwear
 
I summon fish to the dish although I like the chalet swiss
that song is weird
haha
that line always caught my ear because of the chalet swiss. Which is a rotisserie chicken chain in Canada
 
mostly because when I was like.. 10, maybe? We had a [Book-It](http://www.bookitprogram.com/) party at Pizza Hut, and before we got our Pizza this kid asked me:
Kid: What are you eating under there?
Me: What?
K: What are you eating under there?
Seriously confused me: Uhh... I'm not eating anything?
K, now more insistent: No, what are you eating *under there*?
Me: What?
K: You're supposed to say 'underwear', and then _I_ say, "I just made you say underwear!"
Me: Oooooooohhhhhhhhh.
I was totally oblivious
Not to mention at that point in my life I didn't find saying "underwear" a horrible thing.
 
hahah...I remember those from school.
on that note. Gotta go pick up my spawns
 
needless to say, the event stuck with me. So when I heard the BNL song and that line I laughed all the way home. Of course it's also awesome that it has a similar speedy section. Not as bizarre as "chickety china the Chinese Chicken," but still fun
rbrb. Enjoy and good luck
 
9:22 PM
cheers
rbrb
 
9:49 PM
@idjaw It's so dangerous you'd like to sign a waver. Well, hello childhood. :P
 
@Morgan'Venti'Thrappuccino gotta get a set of better clubs/gonna find the kind with tiny nubs/just so my irons aren't always flying off the backswing
@TadhgMcDonald-Jensen I believe you meant [tag:cv-pls]? (Which I just learned like, yesterday :P )
 
testing:
I still don't get why it is used as a tag in chat, it isn't a real tag on Stack Exchange.
 
highlight?
someone might have some weird need to index by the change value minus the count of old palladium elements?
rbrb
 
I've always considered "Make a choose your own adventure game" to be an ideal learning exercise because it's what I did when I was a kid and all the programming nerds in high school were making them on their TI-89's.

That doesn't work anymore though. That kind of programming is only intuitive if with GOTO.
Maybe it's easier to learn how to program in general with GOTO. The concept of an instruction pointer is central to understanding code and in the old days it was explicit in the languages.
 
10:18 PM
@QuestionC I find it significantly easier to read code if the execution is from the beginning to end instead of from beginning to 1/2 to 2/7 to 3/4 to 1/2 again to end
 
yeah, I don't think one should learn programming with gotos because "it's easier"
it's easy like suicide instead of life's problems
programming should be learned properly from the start
@WayneWerner I'm not sure I'm following: palladium is Pd :P
 
Are you suggesting using goto isn't proper coding? I take it you have never used a lower level language.
 
@TadhgMcDonald-Jensen not that low, no
and it's proper coding if you can't do better
but whoever starts to learn coding today, shouldn't have to use goto
and it's way too easy to write way too bad code with it
 
I think programming should be taught as flowcharts from the start, and if you're going from flowcharts to procedural programming there's a huge gap inbetween.
I guess I just don't know how to teach without GOTO because I never learned without it.
 
well, have you considered just replacing all the sections with self contained functions?
 
10:28 PM
guys i have a html php form, i submit, it goes to mysql

how to immedialty run python script on post from php so that, it grabs the data from mysql and start processing? one solution is to use a scheduler, any other solutions, no flask
 
I think you need a state variable and a loop to replicate what GOTO does, which is kind of advanced.

When I say learning, I'm talking on the most basic level, like before you know what loops *are*.
I don't think you can teach loops without at least a concept of GOTO. Like, how would you explain it? When it hits the bottom it goes to the top, does a test, and maybe goes back to the bottom. I feel like you have a mental bootstrap problem.
I want some elementary students and a grant so I can figure this out.
Like... try teaching kids LOGO with and without GOTO. See which ones do better.
 
I don't think that comprehension of jumps in loops necessitate a goto statement
the very reason that loops won't make your code become spaghetti is that jumps are predictable and easy to understand
 
Jumps are goto.
 
yes, but "here kid, jump anywhere you like" and "OK, go back to the beginning of this very specific block" are two very different things in my mind:)
usual disclaimer: I'm not a programmer
but I started learning to program in elementary school, and had no problems understanding loops, without wanting to goto
 
What was your first language?
 
10:36 PM
turbo pascal
at ~12-13 years of age
I've never seen LOGO, so I can't assess if and how goto helps there
 
@Lynob What ever is responding to the POST request would need to initialize the python script, what are you using for your server?
 
11:02 PM
@TadhgMcDonald-Jensen apache
 
do you have direct control over how it contacts the sql? (to say get a python script to finish it and run your extra one)
 
user559633
released a new module to pypi: https://pypi.python.org/pypi/chainload
readme more readable on GH: https://github.com/tristanfisher/chainload
 
11:24 PM
probably because of the parentheses?
 
user559633
thanks @AndrasDeak
 
user559633
weird because that should parse correctly
 
oh cool. @tristan is this in a way similar to hiera?
 
user559633
11:39 PM
not really -- it's just a simple hierarchy without merging
 
@tristan on SO chat (which is not conclusive) you have to escape square brackets: [\[tag name\]](http://link.to.tag) --> [tag name]
round ones are a different thing, I know, but I just wanted to note:P
 
user559633
oh, i messed up and did markdown links in rsst
 
user559633
i wish pypi supported markdown
 
hahah @tristan your "why" for ogre is hilarious
 
user559633
11:52 PM
:[
 
oh was there no happy ending to that story?
 

« first day (2006 days earlier)      last day (2939 days later) »