« first day (2915 days earlier)      last day (2018 days later) » 
04:00 - 16:0016:00 - 00:00

wim
4:00 PM
Any map call that has a lambda as the function arg should be re-written as a list comp
fixed that for ya
 
@vash_the_stampede You could pull that .sort call out of the loop. It's inefficient to re-sort the list on every iteration stackoverflow.com/questions/21471876/… Sure, the OP isn't asking about that, and some people say you should only fix the stuff the OP asks about... OTOH, newbies may think it's ok to do bad stuff if you leave it in the answer code.
 
@PM2Ring is that proper link?
 
@vash_the_stampede Sorry, wrong copy & paste buffer. :oops: That's the dupe target I just hammered that question with. This is the right one. stackoverflow.com/a/52724776/4014959
 
yeah I see that problem, its closed now but yeah I honestly didn't even check his logic on anything because the question/answer was so poor , almost didn't answer tbh
but yeah I agree
 
morning cabbage
@PM2Ring " and some people say you should only fix the stuff the OP asks about..." Those people can be ignored
 
4:12 PM
@vash_the_stampede It's a pretty common newbie error. But surprisingly, I couldn't find a good clear simple dupe target. In most of the potential target I found, the code prints stuff in the function, and the OP can't figure out why it doesn't also print outside the function. But the new question doesn't have any print calls inside the function.
@Code-Apprentice Well, I wouldn't go that far. But I feel no compunction to agree with them. :) Especially with newbie code. Sure, SO isn't a "fix everything for me" site. But newbies need to see good example code, not just a band-aid applied to a single error. Also, if you fix the other stuff pre-emptively, it stops it turning into a chameleon question.
 
@PM2Ring I was replacing starmap in fact (-:
 
Of course, if the code is a big steaming pile of garbage, then the OP should be politely directed to break it up into small MCVEs.
 
wim
what is canonical dupe for merging a list of dicts with some overlapping keys using a defaultdict(list) as the output?
I see these every other day and they always attract crappy answers using groupby
 
idk but cytoolz.dicttoolz.merge_with does that
I think
 
@wim Weren't Antti & jpp discussing that in here a few hours ago?
 
wim
4:17 PM
dunno, didn't catch up, but wouldn't surprise me
these questions come practically every day
 
I'm not sure which question triggered the discussion, so I don't know if it's a suitable dupe target. But yeah, using a defaultdict(list) was much better than the nested dict / list comp that was the other option on offer.
 
wim
Sep 14 at 18:54, by wim
something like defaultdict(list).accumulate_from_pairs(iterable) but with a better name
 
from cytoolz.dicttoolz import merge_with
lod = [{'a': 1}, {'b': 2}, {'a': 3}]
merge_with(list, *lod)

# {'a': [1, 3], 'b': [2]}
 
@wim How's this?
 
wim
question is good, answers not so much
 
4:21 PM
Well, the question isn't that good either. It's pretty much 2 questions pretending to be 1.
Let me know if you find a better one though, so I can add it to my collection
 
wim
on that one I see pandas, numpy, functools, reduce, sorted ..
ok
just want one where the accepted answer uses defaultdict(list) and doesn't even mention all the sub-par options
 
cbg
 
wim
@piRSquared well, that the right idea. do they have a non-cython version?
 
hmm. not sure. will look
 
pfft
I need a weaktuple :F
 
4:27 PM
@PM2Ring exactly. Depending on my mood, I will provide other suggestions beyond the immediate question. I certainly don't limit myself to only fix what is asked about.
 
We have this question about removing a substring from the left, and this one about removing a suffix from the right. Do we need both, or should I hammer one?
 
@wim you should love this
from itertools import chain, groupby

{k: [a for _, a in v] for k, v in groupby(sorted(chain(*map(dict.items, LD))), key=lambda x: x[0])}
 
any ideas... I need to do weakkeydictionary of (class1, class2) =>
 
@Aran-Fey I don't think we need both. But if we do, we also need a 3rd one to cover .rstrip. ;)
 
No one's asked that one yet! Easy rep!
 
4:34 PM
@wim updated answer with non-cython stackoverflow.com/a/52725397/2336654
 
@AnttiHaapala Use a typing.NamedTuple I guess?
 
@Aran-Fey but it doesn't help :D
 
Oh...
 
perhaps if I do weakkeydict=>weakkeydict=>value
 
How about something with __slots__ = ('a', 'b', '__weakref__')?
 
4:38 PM
There was a case a week or so ago, where the OP wanted the indices in a list of the strings before and after their search string. They didn't like the dupe target that shows how to find the index of the search string.
Oct 4 at 6:49, by PM 2Ring
On a related note... We don't expect coders to be expert mathematicians. But we do expect them to understand basic arithmetic, like being able to add or subtract one. :) This OP wasn't happy when his question got hammered. The target has heaps of useful information, and he got two specific answers anyway. https://stackoverflow.com/questions/52600341/how-do-i-find-index-before-and-afte‌​r-a-value
Admittedly, you do need to do a little extra work when the index is at the start or end of the list. But still...
 
To be fair, they asked how to get the index and the value of the surrounding elements, so the duplicate does indeed not cover everything
But still...
 
@Aran-Fey I agree with Wim. The top answer there uses Numpy, even though the question isn't tagged Numpy.
 
4:58 PM
It's kind of sad that we don't even trust people to scroll past the first answer :(
 
wim
@piRSquared upvoted. shame about the lamez library name.
 
laurel... true
 
wim
even though the name doesn't inspire confidence, the code quality looks good
 
They may scroll past, but how are they expected to know what's the best answer, apart from looking at the accept, the votes, and the rep of the answerers? I guess they can actually read the answers, see what makes sense, and try running the code... :)
 
I trust 90% of users to scroll past the first answer. It's the remaining 10% that trouble me.
 
5:05 PM
Working on a new SO feature called "Feeling Lucky"
 
5:17 PM
@PM2Ring what is this kid talking about? if you dont sort then the groupby wont work properly, can you confirm or clarify this ? stackoverflow.com/a/52725100/10255652
 
@vash_the_stampede You often do need to sort before calling groupby to bring all the identical items together so they can be grouped. But let me read the question...
@vash_the_stampede Ok. I have to agree with the OP. Using sort+groupby isn't a good strategy here. There's no benefit in performing grouping, and sorting a 2 million item list is time-consuming. The algorithm they're using in the OP is about as good as it gets, although there are minor improvements that can be made, like getting rid of that useless int call, and using a Counter or maybe a defaultdic(int)
 
Okay the solution is not better than OP at the same time I could not use groupby there without sort
I concede then its slower than op
 
wim
Isn't this the same dang aggregate question but instead of accumulating with defaultdict(list) it's defaultdict(int)
 
@vash_the_stampede Don't feel too bad about it. Your approach potentially has one big advantage: lists use less RAM than dicts. So if you use .sort on the input list, instead of creating a new list with sorted, your code will be more memory-efficient.
 
I had it deleted but ill just leave it up i suppose
 
5:31 PM
On the topic of itertoolsy problems, me and Aran-Fey converged to similar answers on Python Equivalent to Ruby's chunk_while? but I can't help but feel there's a nicer approach
 
@wim Very true. I'm curious about the difference between defaultdict(int) & Counter, when you just need a simple count & don't need the other Counter stuff. I assume they're equally as fast, and that a Counter instance is about the same size as a defaultdict instance...
 
wim
I would guess defaultdict is faster
 
if cur_group: yield cur_group strikes me as inelegant. I like my generator functions to have a nice rightwards slant all the way to the bottom. dedenting implies a leaky abstraction.
 
wim
defaultdict gets a C implementation
Counter has an identity crisis and tries to be too many things at once
@Kevin no_item = object() that is only used once for the first iteration is ugly
 
Counter also picked up a C accelerator for __init__/update at some point.
 
wim
5:35 PM
I usually refactor the iteration to avoid those sentinel things
 
Yeah.
 
They both have the same size: when empty, they're both 136 bytes on my 32 bit Python 3.6.0
 
Counter has a C implementation too, for the counting part..
@PM2Ring that's because they are both just dict subclasses.
try:                                    # Load C helper function if available
    from _collections import _count_elements
except ImportError:
    pass
From the collections/__init__.py source code, where Counter.update() calls _count_elements(self, iterable).
 
Actually, I lied (it's getting late, and I can't type). :) Empty plain dict=128, counter=136, defaultdict(int)=132 That's using a simple sys.getsizeof call.
 
@PM2Ring I was just going to test your assertion, because defaultdict has an extra slot over dict.
typedef struct {
    PyDictObject dict;
    PyObject *default_factory;
} defdictobject;
The PyObject *default_factory entry there makes that a little bigger than a standard dict object.
Counter is a pure-python subclass of dict, so that adds the __dict__ and __weakref__ slots, two pointers larger.
and that's born out by your data; base dict is 128 bytes, defaultdict adds 4 for the factory reference, Counter adds another 4 for the second pointer.
Anywho, the difference between defaultdict and Counter is the __missing__ implementation and the fact that Counter.update() counts values in an iterable, in C code.
 
5:45 PM
Thanks. Adding 64 keys adds 1080 bytes to each.
 
The Counter.__missing__ implementation is just return 0. defaultdict.__missing__ is if self.default_factory is None: raise KeyError(key) / value = self.default_factory() / self[key] = value / return value.
(but implemented in C).
@PM2Ring yes, as I said, they are just dict subclasses. Their dictionary storage (hashtables) has not changed. At all.
 
@MartijnPieters Understood. I wouldn't expect the hashtable part to differ. :)
 
Note the big difference between defaultdict and Counter there, in that only one of the two implementations sets self[key] = value in __missing__!
Try out dd, c = defaultdict(int), Counter(), then dd['foo'], c['foo'], then len(dd), len(c)...
And that's because Counter is not conflicted about what it is, it's Python's implementation of a multiset. It's not a mapping from keys to integers, it's a collection of unique values with a counter attached to each, an extension to the set() type, where set()s could be seen as Counter() objects with the values / counts hardcoded to 1..
 
@Kevin this probably wouldn't be considered "nicer", would it? :D
 
@MartijnPieters Good point. dd['foo'] has to create the item if the key doesn't already exist.
 
5:56 PM
Anyone attended Pycon this year?
 
Passing a stateful function to groupby is heretical, but not all heresy is inelegant
 
the string splitting/csv parsing mess from earlier still needs 2 close votes. Choices include, but are not limited to: not useful / too broad / duplicate of something or other
@Kevin Oddly enough, it's probably the most readable solution out of the 3
 
some of these conversations make me smile, such intelligence
 
@2dsharp PyCon UK, yes, PyCon US in Cleveland, no.
@Kevin heresy shmeresy.
 
Move fast, break things, including standards of purity
 
6:09 PM
And itertools.count() is state, so there.
 
the dictionary of Python really pales in comparison with current java Map :(
 
groupby(sorted_list_of_integers, key=lambda v, c=count(): v - next(c)) uses state to group consecutive integers.
@AnttiHaapala meh, Java is a very different language.
 
@MartijnPieters meh, that's not a reason.
 
@AnttiHaapala: Are you talking about all the stuff they added to the interface once default methods were a thing?
 
@user2357112 yea,
like merge(K key, V value, BiFunction<? super V,? super V,? extends V> remappingFunction)
 
6:11 PM
What's so good about Java's Maps?
 
@AnttiHaapala it is, because that difference drives standard library development
 
is there any flag that will preserve leading zeroes in the python csv library 2.7?
 
there are the nice methods like computeIfAbsent and such
@abhi scusi
 
@abhi what do you mean? Leading zeros can't be preserved when parsing strings into integers.
 
IIRC, most of the stuff added to Map was for concurrency support, and Python's concurrency support is still bad.
 
6:12 PM
@abhi csv deals with only strings, so how do you somehow lose the leading zeroes?
@user2357112 yea that too...
 
So if you have strings with leading 0 characters, don't convert to a numeric type if those leading characters are significant.
 
and there are the other concurrent data structures.
 
@AnttiHaapala I actually posted a question on this, just now.
if only there was a way to define certain fields as "NON-NUMERIC" and make the csv library treat them as such.
 
csv doesn't treat anything as numeric.
 
row_output.append(int(col))
this? you're explicitly converting all leading zero stuff to
 
6:15 PM
@abhi that's not Python 3 code.
Because there's a syntax error in the except ValueError, e: line otherwise.
@abhi: and please don't post about your question you just posted on the main site, in here. See the room rules at sopython.com/chatroom
 
@MartijnPieters great! I just returned from my first Pycon, in Pycon India.
 
Yes. It is python 2 code.
 
I had the opportunity to code side by side and have lunch on the floor with Carol Willing. Chatted Travis Oliphant and Armin Ronacher.
 
@abhi: Then why did you tag it Python 3?
 
@MartijnPieters Point taken. I won't do that.
 
6:19 PM
Although I'm not much of a python person, I'm in love with the community.
 
another question -NOT POSTED on SITe.
I saw an ad for kite development tool
has anyone used KIte?
 
@abhi then don't use the python-3.x tag.
 
I swear, I added the 2.7 tag. I even wrote that in the edit comment.
 
well, not me, as "kite for linux is almost done now (tm)"
 
I've very briefly tried kite out early on when they were the Alpha stage.
It's not something I'd use as it requires you to send your code to their cloud services. That doesn't mesh with proprietary codebases for clients.
 
6:23 PM
@MartijnPieters btw, I started writing a replacement for ZCA that would work nicely with classes instead of interf*ces: github.com/tetframework/componentry/blob/master/src/componentry/…
 
@AnttiHaapala interesting!
 
I downloaded kite yesterday, but I didn't sign up yet.
I think it forces you to sign up before you install the thingy
 
6:37 PM
@MartijnPieters if possible even a drop-in replacement for most cases. So far I've spent about 1 hour so nothing conclusive yet.
if the structural typing becomes a thing, then I hope that could fit there too
 
@abhi yeah I didn't like when it said it wanted to send my code back to its servers
@MartijnPieters ah - yeah.
 
import collections
import itertools
import numpy
import operator
Event = collections.namedtuple("Event", ["name", "timestamp"])
events = [Event("foo", 0), Event("bar", 1), Event("baz", 10), Event("qux", 12), Event("Larry", 17), Event("Curly", 21), Event("Moe", 25)]
predicate = lambda prev, cur: cur.timestamp - prev.timestamp <= 4
groups = [[*zip(*v)][0] for k, v in itertools.groupby(zip(events, numpy.cumsum([int(not(p[0] is None or predicate(p[0], p[1]))) for p in zip([None]+events, events)])), key=operator.itemgetter(1))]
Nailed it B-)
 
It's funny, because we run our code through github, a hosted CI tool, a code quality tool, etc etc.
 
pretty sure for example facebook doesn't have the code in bitbucket :P
 
True> But I didn't think he worked for fb any more.
 
6:44 PM
maybe he is consulting for them under NDA
 
Anyone know a good way to check if Python code is syntactically valid, given its filepath?
 
It bothers me that np.cumsum doesn't work on generators. I guess they don't count as "array-like" which is all the function is guaranteed to work on
 
wim
@AdamSmith parse it
 
@Kevin np.cumsum([*genexp])?
 
wim
import ast
from pathlib import Path
ast.parse(Path(yourfname).read_text())
even np.array doesn't work with a generator
 
6:48 PM
of course it doesn't
hmm except if you provide dimensions?
 
wim
The number of times I wanted array(<generator object <genexpr> at 0xcafef00d>, dtype=object) is approximately zero ..
 
does Path do anything critical here? I'm on py2.7 and don't have pathlib
 
@AdamSmith pathlib2
 
@AdamSmith Not really. Anything that loads the file's contents into a string ought to work.
with open(filename) as file: ast.parse(file.read()) for instance
 
@piRSquared ehh not worth adding another dependency, but thanks :)
@Kevin that's what I figured, thanks!
 
user6718998
6:51 PM
Hi guys. Can somebody tell me, in God's name, why is there on the whole web, no example of deploying a python script on a supercomputer ? It's driving me crazy
 
@Thewise mysupercomputer$ python myscript.py
 
wim
because not many people own supercomputers
 
user6718998
@adam my problem is deploying
 
wim
It's driving me Crayz
ftfy
 
user6718998
anybody here deployed code on a supercomputer before ?
 
wim
6:53 PM
Yes
but it's not the kind of thing I can help you with in this chat room ..
btw if you want to go fast with Python you use a cluster, not a supercomputer
 
grr that's something that's still on my bucket list :P
 
I've always assumed that most supercomputer programs were written in languages that are considered fast. C, Fortran, that kind of thing.
 
numpy is in fortran :P
hmm "The Sisu supercomputer (sisu.csc.fi) is the most powerful supercomputer in Finland and one of the most powerful in Northern Europe."
The current second phase of Sisu consists of nine cabinets, with a total theoretical peak performance of 1688 TFLOPS.

1688 compute nodes, each with two 12 core Intel Xeon E5-2690v3 (Haswell) 2,6 GHz CPUs, totalling in 40512 cores
64 GB of memory (2,67 GB/core) in each node
Aries interconnect between compute nodes
that could run over 30 tabs in firefox.
 
I have seen a super computer only in photos.
and there was an anecdote about Seymour Cray meeting Steve Jobs, that I am sure everyone here has heard of.
 
that's the prettiest computer case I've ever seen:
 
7:04 PM
Let's assume that having your programming team port your Python application to C, and moving your program from regular hardware to a supercomputer, have about the same performance benefits. What's more cost-effective? Google tells me it costs ~$1100 an hour to rent the 100th fastest supercomputer in the world.
It's hard to perform a comparison here, because there's no strict relation to "number of instructions required to complete executing" and "amount of time required to port the entire code base". Sure, both of these values tend to go up for more complicated projects, but not at a steady rate.
I can write a one line program that takes ten billion years to complete, and a ten gigabyte program that executes immediately.
 
there are no Finnish computers in top 500 but all of them run an operating system that was started by a Finnish student having ordinary Finnish people management skills.
 
playing the Linus card, eh?
@PM2Ring I see, thanks
 
better than the AH card?
 
@AndrasDeak I tried to find some solid info on the early history of Tkinter, but I gave up after 15 minutes of going around in circles.
 
@PM2Ring I doubt OP beginner can follow this but for my learning purpose can I trim this down, with the same concept converting this text to a dictionary? stackoverflow.com/a/52727874/10255652
 
7:17 PM
it's OK, thanks :)
 
No worries. :) I get a little annoyed when I can't find references to back up claims that I make...
 
the best claims are unfounded
 
after lunch cabbage
 
What's the bet that this is a LPTHW question? stackoverflow.com/questions/52727789/…
 
__import__('tkinter').Tk().tk.eval('puts "Hello world!"')
MY FIRST EVER TCL PROGRAM!
 
7:22 PM
someone should make a modern tcl called pink
 
whoosh?
 
@AnttiHaapala Do you have tclsh? It's in /usr/bin/ on my machine.
@AnttiHaapala "Tickle me pink" is an idiom.
 
I did
 
tcl is pronounced "tickle"[0], and there's a common idiom "well tickle me pink"
 
^[citation needed]
 
7:24 PM
[0]: that's how I say it
 
I guess I am one of today's lucky 10k.
as always
and apparently it is already 2nd time that it is used in the room:
Jul 24 at 16:17, by excaza
@Code-Apprentice would you like Tickle Me Pink or Macaroni and Cheese
 
unclear / no MCVE stackoverflow.com/questions/52727789/… And no feedback from the OP
 
closed
 
@wim What should happen if the code is invalid? I'm getting an _ast.Module either way. I expected an exception
 
compile the parsed ast
 
7:38 PM
Isn't that what ast.parse already does?
parse(source, filename='<unknown>', mode='exec')
    Parse the source into an AST node.
    Equivalent to compile(source, filename, mode, PyCF_ONLY_AST).
 
Some invalid constructs are silently parsed by the ast module and only throw an exception when they're compiled
No, ast.parse calls compile with PyCF_ONLY_AST
well, I guess you can skip parsing the code and just pass it to compile directly
 
I'd expect parse to crash with a Syntax Error for your average run-of-the-mill syntax errors. ast.parse("1=1") crashes, for example.
 
@AnttiHaapala numpy is C, scipy is fortran
 
hrm I suppose. My test case was just keyboard soup, but that might be a name in whatever namespace the node is exec'd in so it's not a SyntaxError
 
If you have a string that's not syntactically correct, but doesn't crash when fed to ast.parse, I'm interested in seeing it. I'm curious what an invalid construct might look like.
 
7:42 PM
ast.parse("jkasdfjkladfkjlas")
 
Well there you go. That's a NameError, not a SyntaxError :-)
 
to get what I'm shooting for, I guess I'll have to exec all the code, not just parse it. Ugh.
 
Determining whether a name will resolve to a value at runtime is about as hard as the Halting Problem, I wager.
 
I wrote a program to solve the Halting Problem once. I'm still waiting for it to finish....
 
I'm approaching 20.5k rep again. Does anyone know any easy (but good) questions with bounty-worthy answers? For example like this
 
7:53 PM
But... That's an example of an answer not worthy of a bounty
 
@AndrasDeak well I don't know to what extent numpy can/does utilize fortran libs but... i sit important
 
@vaultah People don't answer old questions often enough, so I want to reward people who put effort into creating something better and don't just accept the old subpar content. Totally worth a bounty.
 
@AnttiHaapala a lot, mostly blas, but that's not part of numpy itself
and blas/lapack has c bindings
an numpy internals are in C
 
SciPy has a bunch of Fortran in it, but I don't think NumPy does.
hm, looks like that was already mentioned, kind of
 
wim
@Kevin I had one..
>>> import ast
>>> ast.parse('del *a')
<_ast.Module at 0xcafef00d>
>>> del *a
  File "<ipython-input-3-afade4a2c9c8>", line 1
    del *a
       ^
SyntaxError: can't use starred expression here
 
8:04 PM
SciPy isn't only Fortran. There's a bunch of C in there too.
 
yeah, I know
but the largest chunk of non-python is fortran
but while numpy is majority C, scipy is majority python
 
@Kevin that's the thing, it is syntactically correct. As defined by the grammar
and so is the other thing that does fail ast.parse
 
wow, everyone and their uncle has an answer there
 
I'm afraid I don't know enough about that topic to tell a good answer from a bad one
 
wim
8:07 PM
specifically, my 2018 answer, which is currently sitting on -1, but AFAIK is the only correct answer that somehow escaped everyone else for 10 years.
 
> protected by Antti Haapala just now
 
I guess I'll just send my rep Aaron Hall's way if I can't find any other worthy answers
 
wim
I don't know what surprised me more, the fact that there were 21 answers and nobody mentioned stdlib sysconfig or that I got a drive-by downvote there
 
I've had similar experiences. It's one of SO's mysteries
 
wim
@Aran-Fey this is a noble cause!!
I will also be happy to offer some bounties on good modern answers to old but popular questions
 
8:14 PM
@wim: Perhaps you didn't clearly distinguish sysconfig from distutils.sysconfig.
 
@wim thanks!
 
To someone who doesn't spot the difference, your answer looks like you're just repeating what a bunch of others have already said.
 
wim
@user2357112 I do not need to, because I don't discuss distutils.sysconfig at all (it's an entirely different module)
 
@wim: But a bunch of other answerers have talked about distutils.sysconfig, and your answer exists in that context.
 
wim
OK, I will edit to mention that this is a different module.
 
8:19 PM
also around since 3.2
 
wim
 
8:33 PM
cabbage
Descriptor question. What's the proper way to avoid repition of the melon names in line 12 and 13? pastebin.com/Y6KGhgpX I came up with: pastebin.com/XnmyxuZu
 
in python 3.6+ you can use __set_name__
 
Uuh, nice. The book I'm reading only covers 3.4.
 
3.5 was released 3 years ago
 
wim
I can't see pastebin but is your Q the same as this one stackoverflow.com/q/50477066/674039
 
@AndrasDeak I'm a slow reader.
 
8:47 PM
:)
 
wim
since I have only answer there, am gonna edit this Q&A to remove confusing parent/child language
 
already voted ;)
 
hah Prune gonna kill me
 
Looks perfectly ok to me, FWIW. (Keep in mind that I've made waaay more extreme edits though...)
 
8:58 PM
Required some seconds to parse that this question actually asks the same thing I did. Reads a little "why would you want that?"-like without a better use case to me. But that's not your fault.
 
that edit ...
 
@vash_the_stampede Why, what did you do? ._.
 
wim
I wonder if the new dataclasses use this same thing
 
Just busting his balls with these codes i wrote for and anagram problem, I just threw out this one liner and was laughing in my head what his repsonse is gonna be because its so upsurd haha
 
wim
9:01 PM
my advice: don't answer these garbage questions
downvote and move on
 
I wrote a code I was pretty proud of earlier and I almost didn't submit it because I cracking up when I looked at it like no way OP is going to follow this :/
 
Yeeeaaah, calling str.count twice per character in the string is kind of... inefficient
 
@wim you're not the first one telling him that
 
yeah Im almost at cv privledges too Imma need a run down on that protcol
 
@vash_the_stampede I personally linked you to "that protocol" twice, what more do you want?
 
9:04 PM
speaking of OPs not getting it, this was a bit frustrating as well: stackoverflow.com/questions/52678357/…
 
@timgeb to be fair, decorators are a bit of a mind bender
 
@AndrasDeak sorry I'm very absent minded, but now I have your magic power of memory I'll use that
 
The frustrating part is that I can't explain it better.
 
People sure have a lot of trouble grasping these higher level concepts like functions as variables or lists inside of lists...
 
@vash_the_stampede note that 3k rep won't change anything; you could've posted cv-pls requests before reaching that instead of answering crap
@Aran-Fey lists inside lists are higher level concepts now?
 
9:07 PM
 
Decorators are fine but I still play whack-a-mole with the axis keyword in numpy functions after years of casually using it.
 
@timgeb I wonder how some people are using decorators and not even drilling in basics
 
wim
Maybe my favourite comment on SO:
It's kind of like asking how to drive a nail, but I don't want to use a hammer to do it, even though I have one. I'm not going to explain why I don't want to use the hammer. — Dietrich Epp May 21 '13 at 7:07
 
more than 2 axis does not compute :D
The hammer could be cursed.
 
There are 2 types of people in this world. Those who use numpy for fun and those who don't. — John La Rooy May 21 '13 at 7:27
^ I like that one more (:
 
wim
9:11 PM
In case you missed it, the top answer uses zip by iterating the builtin namespace, lexicographically, and using the "maximum" builtin name (which is zip) :D
 
That's still using zip though
 
wim
exactly
 
but op will never notice :D
 
wim
the OP also asked "without using numpy" and this isn't a problem where anybody would really think to use numpy in the first place
 
@timgeb I don't see any way you can explain it better either. I'm not sure where the hang up is for that OP. Probably a combination of several things such as returning a function and decorators.
 
9:21 PM
right, ideally you play around with map and filter for a while before discovering decorators
 
wim
ideally map and filter are NameError and decorators cost $10 per use
 
As long as you don't abuse lambdas? map(int, argv) >> [int(x) for x in argv]
 
@timgeb stackoverflow.com/a/52729594/1440565 I attempted an answer which mostly repeats what you said.
 
Good, sometimes you just need to hear the same thing, reworded.
 
@timgeb I also used the exact same function and decorator names rather than generalizing.
hopefully it helps the OP...if not, I'm already moving on anyway.
 
10:08 PM
cbg
 
@coldspeed cbg
new avatar, I see
 
hmm... no, been there at least a month now I think
maybe 2. Probably your first time noticing :P
 
11:13 PM
@coldspeed I'm not known for my observation skills
 
04:00 - 16:0016:00 - 00:00

« first day (2915 days earlier)      last day (2018 days later) »