« first day (3170 days earlier)      last day (1779 days later) » 
00:00 - 17:0017:00 - 00:00

wim
5:00 PM
thanks
 
@wim not sure what you mean by "knock it off" as I am going around voting as deleted each one of your posts
 
wim
so why did you delvote that one? what's wrong with it?
 
You got the undelvote, that should be enough, let's stop it at that and not take it any further
 
lol
 
wim
I am getting 2 delvotes every other day on my closed dupes
whoever is doing it is repeat offender and mistakenly thinks they are cleaning up the site or something
 
5:03 PM
@wim sorry to hear that, but that doesn't mean directly harrasing another user with a question like that, sorry but it's not appreciated
 
wim
It's not harassing you to ask why you think the post that you delvoted should be deleted.
 
you can try asking on meta, pnuts will probably see it sooner or later
 
wim
@DeveshKumarSingh So, I'm still curious, why do you think it should be deleted?
 
just FYI, this is a good place to start if you're itching to delete bad stuff. Also the links I've repeatedly posted here linking to off topic closed python questions that cannot be roomba'd. Blatant dupes are fair game. Old posts (even if they're dupes) are better off being left alone unless there's a real problem with them existing as-is.
 
5:07 PM
@wim now you're entering harassment territory
 
@cs95 not necessarily. That's exactly where misguided deletion sprees pop up, and piling up is what we don't need.
 
The RO sensitivity training courses did not prepare me for this
 
I'd rather people start deleting downvoted useless no-roombas
 
The purpose of that link was to find stuff to delete without having to target anyone specifically. It is also implied that you use discretion there as well :)
 
we wouldn't be having this discussion if discretion was implied anywhere
 
5:10 PM
@AndrasDeak you mean this, I think
 
needs moar pages
 
@wim Can one actually solve the puzzle on your personal site (the one linked in your profile) or is the interactive graphic simply to illustrate the gist of a solution?
 
wim
@Dodge you can not solve it on my website, if that's what you're asking.. you can prove it using a pencil and paper :)
 
yuck. those search results have grown by a full page since I last ran the query
 
wim
@cs95 there is no point to this activity
 
5:14 PM
@wim Okay cool. I was hoping to open the door to some virtual treasure trove but no amount of mouse movement solved the problem
 
wim
clicking through a handful of those posts, most of them only have ~50 views
they have low views, why give them any more attention? these tasks are better handled by automated tools than manual labor.
 
No, no, you see, you can feel unlimited power using your delvotes for pointless things
 
are you saying run a script using the StackExchange API to automatically cast del-votes on those posts? We run into the discretion issue all over again. Then again when you start from the bottom of the pile there is very little hope of salvaging anything
 
wim
no, I'm saying it's a waste of time and benefits nothing
 
@cs95 I don't think anyone is suggesting that, and nobody should
 
wim
5:17 PM
if there is bad content that gets high views, that's the stuff you could worry about ..
you don't even save disk space for stack exchange, since it's soft-delete anyway
 
Isn't the goal of this site was to maintain a good signal to noise ratio, and deleting crud like this is exactly what improves it?
 
wim
it's not noise because it's not found (except for crazy search queries like you're doing in order to try and find it)
 
Isn't the number of viewers a signal?
 
wim
it will not help the best content bubbling to the top by going and deleting the tail end of absolute garbage, that stuff that is already on the bottom anyway
 
OK, then sort by newest and start from there, or is there something wrong with that too?
 
5:21 PM
I'm here to artificially inflate my ego. If SO wants me to pursue any other goals, they better write me a check.
 
OK, fair enough. Just curate your own content because nothing else really matters.
 
there you go
 
wim
my problem with regular members taking on too much janitorial roles is that they do it wrong, or do it in a way that is detrimental to the site
the elected moderators generally have enough experience to do it in a way that is more beneficial for the site
 
elected moderators don't bother cleaning up old closed posts because that's not their job
 
wim
yes they do. JFF has been doing it a lot.
 
5:25 PM
he'll burn out eventually
 
Accept the fact that we're all living in a broken system and come cavort in the ruins with me
 
@wim ah, it makes sense I guess
 
wim
see here (10k+ only) for example (the comment thread)
 
"Why does python live on land? Because it's above C level"
:|
 
wim
closed as dupe, all dupe answers were bad, then he found a better one, eventually deleted - ok
 
5:34 PM
@wim he also wasn't a mod back then
 
wim
my point is he's got justification and is trying to make the site better, not just blindly and indiscriminately downvote/delvoting like cs95 seems to be calling for
 
I think I've seen him being too trigger-happy from meta posts, but I don't remember specifics. Wouldn't be surprising, anyway.
 
wim
I agree on the trigger-happy but at least he explains his actions
 
@wim that is just not accurate. I don't recall asking anyone to downvote anything either.
Jun 6 at 4:14, by cs95
please use discretion and keep an eye out for stuff that should not be removed.
said this multiple times.
 
@wim I prefer "don't shoot me" to "why did you shoot me?!"
 
wim
5:37 PM
@cs95 ok but it's a bit like the "warning hot coffee may be hot" warning on the hot coffee
just lip service
 
I'm not gonna take sides in any of this but "stuff that should not be removed" is obviously subjective. The one thing a mod can do is (try) keep a consistent view on what is/is not acceptable. Once you open the list to the community, you have to deal with all the rest.
 
Yeah, I definitely bungled up big time here. People like complaining about how many terrible questions are being asked and answered, and how people are whoring rep and it's getting on everyone's nerves that these questions are not being closed and removed fast enough. At the same time people also get annoyed when you try to make an actual effort to do something about it, because it's not worth the effort and because people don't do it right.
I should stop being a helpful citizen and just sit back and complain like everyone else, it's just easier :P
 
As far as I can tell you didn't try to make an actual effort to do something about it
 
do exhausting your delete votes everyday for the past week count?
if not, then no, I did nothing about it
 
I thought you were talking about your crusade here to delete old things
 
5:50 PM
yes? what do you think I exhausted my delete votes on. Yeah, I could've done that myself from the get go; all I was asking for was help. "crusade" is a big word to describe that.
 
IMO I think it would be better just to let this one slide. Your bungling was only in regards to the expectation that there can be a consensus view, not your motivation. Just look at Meta; it just descends into a mess on anything that isn't obviously cut-and-dry
I also think that everyone participating in this convo now is reasonably aligned in interpreting "stuff that should not be removed"
 
@roganjosh amen to that :)
[tag:cv-pls] https://stackoverflow.com/questions/56708323/inline-for-loop-with-array
Probable Dupe of https://stackoverflow.com/questions/509211/understanding-slice-notation based on the comment by OP
 
wim
6:11 PM
check this list for potentially useful content deleted by vigilante -> stackoverflow.com/search?q=user%3Ame+deleted%3Ayes+votes%3A3
 
nevermind, getting late
 
wim
hah
 
That's a depressing link, please don't do that :P
 
@wim Not sure how to respond to that , this is getting out of hand
 
"OMG I'm at the top of the list" was a genuine panic there!
 
wim
6:12 PM
@DeveshKumarSingh it didn't require your response
 
@DeveshKumarSingh I misunderstood what he was saying at first. He meant you could check your own posts to see if others have deleted them when they shouldn't have.
 
wim
^ exactly
 
10k+ of course
 
sorry I didn't still get you
 
The top of the list is a question with 19 upvotes, deleted by wim (and 2 others) :P
 
wim
6:14 PM
ironic
 
@AndrasDeak okay and what do I do with that information?
 
@DeveshKumarSingh it wasn't targeted at you, the link just makes it personal to you
 
I suggest spreading it on bread, they say it goes great with jelly.
 
@wim well it's my user id, why should I not respond, I didn't run any such query on your id
 
oh, I see :D
 
6:15 PM
@AndrasDeak haha, that's a good one
 
read his link carefully, before clicking
 
@DeveshKumarSingh
3 mins ago, by roganjosh
"OMG I'm at the top of the list" was a genuine panic there!
 
try to find your user ID in there
hint: only you and mods can search your deleted posts
 
@AndrasDeak got it! apologies for the knee-jerk reaction all, my dumb brain now gets the joke!
 
This reminds me of the old days when people would post that one image that displays the viewer's IP address, ISP, and approximate physical location. Good way to scare the less technically savvy.
 
6:18 PM
"the old days", plus @PM2Ring monthly ;)
 
Well now I'm totally offended. Are you saying I'm "less tech savvy"?! :P
 
@Kevin That image still scares the everloving bejeebus out of me
 
We're all less technically savvy than somebody. Unless you, the reader, are the single most savvy person on earth.
 
"Everyone in this universe is less savvy" :P 23:49 quotes..:D
 
I want to name some famous engineers but probably the most technically savvy person is some embedded systems designer that we've never heard of
 
6:21 PM
the technology moves so fast nowadays that people in their late 20-30's are less tech savvy then people in their teens
btw if you flag a link-only answer and it gets accepted? Does that affect the flag?
 
@DeveshKumarSingh you predicted correct..
 
Define "technology". Javascript frameworks change every week, but assembly code doesn't.
 
But Stoles played well so I am happy
Stokes
 
@DeveshKumarSingh no
 
@anky_91 yeah they only have one gear, their are in deep yam now :/
@AndrasDeak okay thanks
 
6:28 PM
@DeveshKumarSingh yep..!!
 
6:42 PM
I'm thinking of telling the OP of Python decompression relative performance? to replace his manual pickling approach with numpy.save. Or should I not bother? The docs make it seem like it's using pickle under the hood anyway, so maybe it wouldn't improve his file size at all.
 
@roganjosh closed
 
One demerit to the scipy.org docs for mentioning two places to see the .npy format, one of which has no hyperlink, and the other which has a dead link
 
And two demerits to Google for always always always linking me to outdated versions of the numpy docs
One additional demerit to scipy for not having a version number dropdown in the corner like the python docs have
 
@DeveshKumarSingh I categorically disagree. Many middle school and highschool students I encounter don't know basic maintainence tasks on their phones, and many neither have nor know how to send an email, on their devices, never mind on Windows/Mac/*nix.
 
6:47 PM
But I bet they can put cat ears on politicians faster than you
You know, the useful stuff that tech provides
 
@toonarmycaptain Perhaps i should have said more apt in using all the latest apps, but lacking is basic usage of technology? Also they snap and insta, why would they worry about an email :D
 
I'm not particularly interested in how technically savvy the muggles are. It's the STEMmy types I'm interested in. I'm inclined to bet that the average 30 year old programmer is more savvy than the average 16 year old one.
Considering 99.9% of SO questions that end with "go easy on me, I'm only 16" are unsalvageable
 
muggles haha, i am a STEMmy too lol
 
@Kevin mostly unrelated, but what was the git course you were working through? I need to do it myself.
 
learngitbranching.js.org I tried it myself too, it's pretty good
 
6:53 PM
Thanks :) I was a at a bit of a loss on what to search in chat because I was half paying attention on my phone at the time
 
@roganjosh no worries, happy to help
 
From my question this morning about cascade deletes in SQLAchemy, I think I've seen a hole in the libraries available. I'm not sure if it will be of any use to anyone else, but it's a good way to throw myself into the fire to learn about distributing packages.
 
I have reached the "knows just enough to be dangerous" level of git competence. I know what the ~6 most useful commands do, but I don't know any community norms / idioms / design practices
 
those might be what your company follows with their codebase
 
It's like going hunting when the only instruction I've received is on the chemical reactions involved in gunpowder
My company doesn't use git, chaos reigns :>
 
6:58 PM
then perforce?
 
Team Foundation Server.
 
@Kevin how do you even think of such quips, do we have a book for all your quotes till now on room 6?
@Kevin this looks pretty GUI'y , looks like no cmdline involved
 
No thinking required, I just constantly expectorate whatever pablum comes to mind, and by definition 1% of it will be top percentile stuff.
 
wim
SO chat search is forever a mystery
why the results for "learngitbranching" are not a subset of the results for "learngitbranching.js.org" search?
 
It's a random mess
 
7:05 PM
@Kevin Also that question needs severe edits/formatting to state the actual question and context clearly and legibly.
 
One demerit to the chat search for not letting you type "me" into the "said by:" field
Heck if I can remember my numeric id even on a good day. I think there's a 4 in it?
@smci Yeah, but even when a Q is vague I don't mind trying to point to useful bits in the docs, which is all I've done so far
 
@Kevin expectorate, now that's a word I have only seen in cough syrups, first time I have seen it being used in a sentence :)
 
@Kevin should be clearer in the next version github.com/numpy/numpy/pull/12922/commits/… ;)
 
@AndrasDeak nice, good to know you commit to numpy :)
 
Mostly docfixes though
 
7:09 PM
Does the final paragraph of docs.scipy.org/doc/numpy/reference/generated/… imply that .npy files can skip using pickle and just pack bytes directly if the dtype is amenable to that? Or am I misreading it.
 
@AndrasDeak the last two were proper code commits :)
 
Yup. With allow_pickle=False you can still read non-object arrays
I.e. most sane arrays
 
I probably could have answered my own question about a thousand times faster if I had just constructed an array and tested it myself.
I'm... I'm part of the problem
 
@Kevin I edited it so it can now be read in 10sec. It's an interesting question, hope it gets traffic.
 
I do like ascii boxes.
 
wim
7:20 PM
adeak got that AoC green stripe in december :D
 
alexandra ocasio cortez?
 
Advent Of Code, most likely
 
okay, the website looks interesting, let me have a look-see
 
I'm off out for a bit, but I'm not sure my comment deserves a star, it was just part of the discussion and it doesn't check the useful or humorous boxes. Please consider removing the star.
 
@roganjosh maybe someone wanted to dig that hole :)
 
7:26 PM
I dug my way out of my last hole by going all the way through, coming out the other side, looping around the globe, and making things add up. Then I refactored :)
 
@roganjosh then maybe to fill the hole you have digged :P
 
... I just don't know what's going on with the starring of my comments right now
If I was "shooting for the stars" then I would understand, but these are pretty benign comments
 
@roganjosh maybe it's the same bunch you gave you +40 rep the other day?
 
It's beyond my problem. I really don't think I can do anything here so I'll walk away from the PC.
 
@wim yup, same each year
 
7:30 PM
rbrb \o
ohh so rbrb is for saying goodbye yourself, and saying goodbye to someone else too
 
If it's you that's doing this to make a point against the ROs then I'm pretty disappointed that you're using me as a tool to make that point.
 
@roganjosh who me? no man, I won't do such a thing
 
I'll take your word for it, but it's silly now. rbrb for a bit
 
"teehee, I'll arbitrarily star a message discussing the act of arbitrarily starring messages, because I delight in its metaness" is something that just happens every once in a while. It's mostly harmless and I usually just go delete the stars 24 hours later when everyone's forgotten about it
 
@roganjosh sure, I can't make you believe me otherwise, but it's odd you would think that
Plus I don't have a thing about RO's here, they are doing their best to keep things civilized here
we have good cop and bad cop here
 
7:37 PM
And lawful evil cop
 
@DeveshKumarSingh I will apologise for that. I didn't implicate you, only appealed to you in case it was you. Beyond that, I don't know who is doing it but Kevin has given some insight
 
@AndrasDeak guilty as charged
 
I think of us as slacker cop / actually trying to effect change cop
 
@roganjosh no worries, things have been a bit haywire today in the group with people implicating each other since someone pointed out the delvotes link :) but I wouldn't worry about it too much as Kevin said
 
If I have an array object in my config file how would I compare a value and return true or false if any are found?
 
7:39 PM
What kind of config file is it?
 
@Kevin can we have a poll on who is who?
 
wim
Apr 24 at 17:35, by vaultah
Starred messages is a very serious matter
 
configparser is good for .ini configs, json is good for json configs
 
Eg
#config.py
config = {
array_obj: ['123','456']
}
#main.py
ID = 123
 
Just importing the config file is good for configs that are syntactically valid Python files
 
7:41 PM
In that example how owuld I check to see if ID matches any of the array_obj
 
ID in config['array_obj'] ?
 
Hmm, that's not quite a valid Python file, since array_obj is undefined
If it was "array_obj": ['123','456'] instead, maybe you could do import config; print(ID in config.config["array_obj"])
 
side note: array_obj should really be list_obj because it's not an array, it's a list
 
and people have started putting dog ears in SO profile pics
 
@Kevin yes sorry it is defined correctly I just wrote an example to explain my problem
With your suggestion, how does it work?
I'd like to use a if statement or something of the sort
so I can do one thing if the ID matches and another if it doesnt
 
7:44 PM
Ok, then if ID in config.config["array_obj"]:
 
@Kevin Amazing that did it!! Thank you :)
 
config is the module object representing your configuration file. config.config is the dictionary named config that you defined in your configuration file. config.config["array_obj"] retrieves the list inside your config dictionary. ID in config.config["array_obj"] performs membership testing on the list to see if ID is in it.
 
as good as an explanation as any :)
 
^ yes thank you for that!
explanation was very helpful
 
If I were writing a configuration file like this one, I might be inclined to delete the config = { bit and just make array_obj a file-level variable: array_obj = ['123','456']. Then the syntax to access it is more straightforward: if ID in config.array_obj:
Not that there's anything wrong with having a not-completely-flat data structure in the config file. It just seems like this toy example doesn't merit anything that fancy.
 
7:48 PM
Yes unless you have a a nested dictionary sort of situation, a list is definitely a good choice
something like
config = {

'config_1': {
    'array_1': ['123','456']
},

'config_2': {
    'array_2': ['123','456']
}
}
 
Yeah I might change the way the config file is done, I had just planned it that way because I expect I may end up using the same names in there
but I could always name them slightly differently lol
 
If you have the same key array_obj`, just define it as ARRAY_OBJ = 'array_obj' at the top
 
Keep in mind that dictionaries can't have duplicate names either. For example, {"a": "b", "a": "c"} just becomes {'a': 'c'}.
So if you wanted to have multiple array_objs, just putting them all in one dict isn't the solution
 
Yeah I was planning for something like
a = {
"a": ['a', 'b']
}
b = {
"a": ['c', 'b']
}

etc
 
That would work.
 
7:53 PM
Hopefully shouldn't need to worry about it too much right now as the config files fairly empty anyway lol
but thanks for the help and suggestions :D
 
8:15 PM
I suspect the latest xkcd will be popular:
 
why are some arrows going left and some to the right
aah this is a pretty accurate representation of how python looks to a new user
What happens in the background if I do something like
list(itertools.count())
Is there a point where the constructor stop building the list, or it just continues till it runs out of memory?
 
8:38 PM
@DeveshKumarSingh Try import antigravity in the REPL
 
@PM2Ring what! how does that came into being
 
@DeveshKumarSingh Hint: the interpreter doesn't have access to a halting oracle.
@DeveshKumarSingh That comic got a lot of people to give Python a try, including me. The Python core devs decided to repay the favour.
 
@PM2Ring so it will continue on till it dies
@PM2Ring aah okay, can't seem to figure out the date it was published
 
I had dabbled in Python a few years earlier, with Python 1.4, but that comic inspired me to give it another try.
 
okay, also ctrl-c doesn't seem to work on the REPL if I run list(itertools.count()), why is that?
 
8:43 PM
@DeveshKumarSingh There's an xkcd JSON feed that's handy for stuff like that.
@DeveshKumarSingh Sorry, I don't know.
 
@PM2Ring no problem :) I thought that KeyboardInterrupt can stop any running python process, but I only tried it with infinite loops
 
No, a KeyboardInterrupt will be ignored by a plain except
 
According to xkcd.com/353/info.0.json it was published on the 5th of December 2007.
 
except Exception will allow a keyboard interrupt to break out
 
I was wondering why it doesn't work with list(itertools.count())
 
8:49 PM
That, I think, will require looking at the source code
 
@DeveshKumarSingh Well, list does most of its stuff at the C level, so as far as the interpreter's concerned, it's an atomic operation. I think. ;)
 
The docs say "During execution, a check for interrupts is made regularly." I assume that atomic operation is also an execution
 
I think there's a demand for a userscript that can append "I think" to messages :P
 
I posted this script a while ago. I don't know if it still works. I'm on my phone, so I can't test it easily. forums.xkcd.com/…
 
I get a ERROR: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056)> perhaps something to do with my network
 
8:55 PM
@DeveshKumarSingh sure, and,as I pointed out, KeyboardInterrupt can be ignored
 
@roganjosh I couldn't think of this in terms of code
 
I'm on my phone atm so can't code. Make a while True loop with a pointless calculation in it, but wrap it all up in a try/except with no specified errors. You won't break it with ctrl c
 
wim
@roganjosh that's not what's happening here.
list(itertools.count()) is too busy in C code for an interrupt to happen
and the issue is still open, sadly bugs.python.org/issue26351
 
@wim so that's an atomic python instruction, made up of multiple c instructions
and keyboardinterrupt only works between multiple python instructions?
 
@wim well, shut my mouth. Thanks :)
 
9:04 PM
seems like there are simpler ways to cause that per the bug like x=[0]*2**30
 
wim
just laughed again at the answer
> The interrupt is handled afterwards, i.e. never.
@DeveshKumarSingh yes, many variations of the same thing.
 
@wim got it, I assume this is what gets called on list()
Is there an step by step explanation of how == resolves somewhere in the docs, I couldn't find one, and the best I could find on so was this
 
probably bits here?
> [...] rather, __lt__() and __gt__() are each other’s reflection, __le__() and __ge__() are each other’s reflection, and __eq__() and __ne__() are their own reflection. If the operands are of different types, and right operand’s type is a direct or indirect subclass of the left operand’s type, the reflected method of the right operand has priority, otherwise the left operand’s method has priority. Virtual subclassing is not considered.
 
okay, I have seen that before, but some explanation there is too technical for me to grasp
okay so if I consider [] == True, the left operand [] has a priority
 
define dummy classes that print when their __eq__ is called
 
9:15 PM
extending list and bool ?
 
if you understand general types then you'll understand specific ones as well, probably
the quote I showed doesn't show the full picture: if __eq__ returns NotImplemented for a given combination then it will try the reflected version
>>> class Foo:
...     def __eq__(self, other):
...         print('calling eq')
...         return True
...

>>> Foo() == True
calling eq
True

>>> True == Foo()
calling eq
True

>>> True.__eq__(Foo())
NotImplemented
>>> class Bar(Foo):
...     def __eq__(self, other):
...         return NotImplemented
...

>>> Foo() == Bar()
calling eq
True
hmm hold on
 
huh True == Foo() and True.__eq__(Foo()) are different
 
oh, nevermind
 
ohh what was the issue?
 
So I'm currently helping a friend build a game and it's kinda slow (we are using pygame). I tried to do some optimizations but then I stopped and asked myself; what kind of optimizations the interpreter already do for me?
 
9:22 PM
I got confused for a second because I got mixed up between the many options in my test (subclass/non-subclass, implements/doesn't implement __eq__). It all seems to go according to the docs I linked moduloe reflection if NotImplemented.
 
Also why did True == Foo() behave differently then True.__eq__(Foo()) in both cases LHS got priority right
 
@DeveshKumarSingh there's no priority in True.__eq__(Foo()), it's a well-defined function call
 
Does it even do simple stuff like pooling calculations out of a loop?
 
@AndrasDeak If the operands are of different types, and right operand’s type is a direct or indirect subclass of the left operand’s type, the reflected method of the right operand has priority, otherwise the left operand’s method has priority I was talking about the priority here
 
on the other hand True == Foo() has to figure out what to do. They are different types but not subclasses -> left operand has priority -> True.__eq__(Foo()) returns NotImplemented -> it tries reflected f.__eq__(True) where f is the original Foo().
@Yonlif no, there are very few optimizations, and they don't usually touch execution. Most optimizations I usually hear about revolve around memory use.
You should expect that what you write will happen as-is.
you can use dis.dis to see what bytecode your code compiles to, and you should be able to track down each operation (in a bit obfuscated way due to how the stack works)
 
9:26 PM
@AndrasDeak So the reflected method of True.__eq__(Foo()) is Foo().__eq__(True) but that's True right
 
well as I understand "reflection" means "calling the reflected method of the other operand, and as the docs I quoted says __eq__ is its own reflection
 
I read that dynamic languages perform many of the behaviors that static programming languages perform doing runtime.
In the light of that, can Python be said to compile on the fly (at runtime)?
 
with something like __add__ the reflected version would be __radd__ of the other operand
@SebastianNielsen no
 
@AndrasDeak ohh okay so what would the reflected version of True.__eq__(Foo()) be
 
I'm not certain of the terminology so I'd rather not answer your newest pointless categorization question
 
9:29 PM
@AndrasDeak hah fair point, lets leave it at that :) I will wait for some one else who can answer it
 
@Yonlif No, it can't do stuff like that. I assume that "pooling" was a typo for "pulling".
 
@SebastianNielsen at least I don't think so. The code is first compiled to bytecode then the bytecode gets interpreted. Technically it's during runtime when you first call python on your code but I don't think that's what people usually mean when they say runtime. For instance code can be cached after which subsequent calls only reinterpret it, I think.
 
I don't get how the computer can "just run" the human written Python code on the fly, meanwhile, e.g. Java has to be compiled beforehand.
 
As I said, python also compiles the code. But bytecode and the interpreter is such that it has to work with on-the-fly determined types, unlike compiled languages that are typically statically typed.
that's partly the reason why python is slower than other languages
 
@SebastianNielsen It doesn't. Like Andras said, it gets compiled to Python bytecode, which it then runs on a virtual machine.
 
9:32 PM
note that you can also compile code right before runtime, which is called just in time (JIT) compilation, and which is what pypy does under the hood
the trick is to compile optimized code for your function when you already know the type of the inputs
 
So, Python just compiles the code automatically I suppose
Unlike e.g. Java
 
yes
also scroll down to Martelli's non-accepted answer
> This popular meme [i.e. "python is interpreted"] is incorrect, or, rather, constructed upon a misunderstanding of (natural) language levels: a similar mistake would be to say "the Bible is a hardcover book". Let me explain that simile...
 
coughs like php runs away
 
well the confusion still stands, if x == y falls back to x.__eq__(y) why is True == Foo() (gives True) and True.__eq__(Foo()) (gives NotImplemented) not the same
 
if I were willing to explain it a second time I'd just be saying the same thing. Go read it again ^
 
9:49 PM
that's absolutely fine :), I would not want you to repeat yourself
 
here:
>>> class Foo:
...     def __eq__(self, other):
...         print('calling Foo eq (not implemented)')
...         return NotImplemented
...
... class Bar:
...     def __eq__(self, other):
...         print('calling Bar eq')
...         return True
...

>>> Foo() == Bar()
calling Foo eq (not implemented)
calling Bar eq
True
that's what I've been trying to explain
if I were @Kevin I'd draw an ascii flowchart but you're out of luck
 
Okay now i get it, Foo() == Bar() can fall back to Bar().__eq__(Foo()) and give us True, but Foo().__eq__(Bar()) being a pure function call cannot do that
Now I understand why you said a well-defined function call :)
 
I'm glad
 
Thanks for the last class example, that made things perfectly clear
But thanks for the patience :) Your students must be very appreciate of you due to this
 
note that I had no idea how these things actually worked until you asked about it and I looked it up
 
9:59 PM
But you picked it up quite quickly
 
which is to say, with some fiddling around you can figure out how things work
 
yes, I think even PM2Ring emphasized on that
2 days ago, by PM 2Ring
@DeveshKumarSingh Partly that comes from writing lots of little examples to test stuff we read in the docs. ;) And partly from seeing clever things in good code. And partly from hanging out here and discussing these things.
trying out what is being read in the docs with examples is a good way to understand what's going on
 
 
1 hour later…
00:00 - 17:0017:00 - 00:00

« first day (3170 days earlier)      last day (1779 days later) »