« first day (2894 days earlier)      last day (2053 days later) » 

3:01 PM
Yeah, probably even further back than I suggested then. It might be better to have it attached at both ends of the horse part
 
Which makes it kinda hard to control the release for the human part. Poor creatures.
 
Hmm, trying to remember how KevinScript does its ast evaluation... I don't remember specifically guarding against stack overflow. Maybe I should write a test program with 200 nested ifs...
 
I'm inclined to think that their hind is the heavier part of the horse body, so it should counterbalance the human weight at the front. Plus, if it's nearer the midriff, it's easier for him to turn round and cut himself free
 
I would write a test case, but I can't remember how to run this thing
 
The stack of iters pattern might be useful here...
 
3:11 PM
1+(2+(3+(4+(5+...)..)
 
Of course, it means you're recursing breadth first, rather than depth first.
 
BFS DFS both can be written in non-recursive form...
In my example code I used yield for the non-recursion version do2_if, but that design pattern is strange. So I wonder a better design so that do_if become as natural as/more natural than the first do_if.
 
c:\Programming\Github\KevinScript>python -m ks samples/overflow_test.k
Traceback (most recent call last):
  File "C:\Programming\Python 3.6\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
[500 lines of stack trace goes here]
  File "c:\Programming\Github\KevinScript\ks\eval_ast.py", line 301, in evaluate
    return evaluate(node.children[0], scopes)
  File "c:\Programming\Github\KevinScript\ks\eval_ast.py", line 121, in evaluate
    if scopes == None:
RecursionError: maximum recursion depth exceeded in comparison
Hmm, unfortunate.
 
@roganjosh a centaur contortionist is something I would love to read about.
 
@Thiner Sure. And in fact that stack of iters code I linked doesn't actually use recursion. Sorry that my terminology was misleading. I should've said something like "But of course, you're traversing the tree breadth-first instead of depth-first".
 
3:24 PM
By the way I have had bad experience on stack overflow when using pypy - I do not have any method to enlarge the usable stack, ulimit/sys.setrecursionlimit/... Also I am not sure what will happen if the nested calling stack contains functions using C library (ctypes/cffi/...)
 
DSM
Tuesday cabbage for everyone!
 
cbg \o DSM
 
Pretty sure Python only counts Python functions on the stack when determining whether to raise a RecursionError. Of course, C library functions are perfectly able to cause a stack overflow on their own, but that limit should be substantially higher than Python's recursion limit.
 
You could pretty easily test that by writing a small recursive function in C and linking
not if ctypes vs importable code would change anything
 
3:39 PM
I tried to make it as simple as possible removing other details that were not necessary, but that is the main idea
I have other scenarios where they aren't docker-images that change it a bit
 
This problem would be less awkward if you could access the return value of an exhausted generator
You can extract it from the StopIteration object, but that's rather ugly
 
@shad0w_wa1k3r Almost, Steve Holden does his best, but my name defies pronunciation. Apparently.
(I edited my original post to swap Youtube links, the old version is no longer online, it has been replaced with another to fix a sync error).
 
DSM
> I have a dictionary: list = [1, 2, 3, 2]
 
His percentage calculation is even better.
 
3:58 PM
Great, end the working day failing miserably to use json_normalize on what I thought was going to be a simple question :/
 
DSM
Moral of the story: only work in the mornings. Afternoons are for play.
 
Honestly don't know what I'm doing wrong but 10 minutes of brute forcing different interpretations from the docs and still failed every one
 
DSM
Could you mcve it?
 
I just did a quick scan before leaving the office, saw "Oh a JSON question, I can answer that one quickly enough". I was wrong.
I can't decide whether the OP's initial normalisation from read_json is necessary or not to do a preliminary flattening
Or whether to start with 'events' as the string and try define the structure from there as those nested lists
 
rbrb guys, have fun.
 
4:06 PM
> I have a dictionary: Array = [ foo => bar, spam => ham ];
(and yes, that's a real example)
 
rb folks
 
Hmm, there's a weird "seam" in my data that I thought would be evenly distributed. I'm going to blame... [spins Wheel of Scapegoats]... Floating point numbers
It's not a fluke either because it shows up in 63 other trials
 
@Kevin crop out that bit and problem solved!? :p
 
Genius!
I think the problem basically boils down to: each of these points is calculated by generating two random points and then finding their midpoint. Even if the generated points are evenly distributed, their midpoints are biased towards the center.
(The void shows up around the bottom third instead of the very bottom because I shifted the viewport by 33%, for Reasons)
 
@DSM it's quite interesting. Even the questions about json_normalize get answered with different methods and the one answer from coldspeed I found stops at what I did in my first comment. The doc examples are not clear to me at all.
 
4:24 PM
@Kevin Can I ask you for a status update on this? Is that a mistake in meeting summary or did we actually not reach a decision?
 
4:40 PM
@Aran-Fey IIRC there were many suggestions but no consensus. Sentiment among the ROs since then is approximately "well, let's just implement something and see if that focuses the requirements for v2.0"
 
Ok. Is there a rough ETA for this "something"?
 
Not that I'm aware of. I acknowledge that this is a problem.
 
Alright, I'll be patient for the time being. Do keep us updated about the progress though
 
Oh boy. This OP is using Python 2.4.3 stackoverflow.com/questions/52390887/…
 
@PM2Ring wrap the open in a try/finally I guess... I think finally was about in 2.4... I think else might not have been... or maybe it was finally that wasn't... that was so looooooong ago...
I'd have thought finally would predate with because of what it does... but I know one of those didn't exist...
 
4:51 PM
Context manager came in 2.5
 
I know that... but there's now try/except/else/finally - one of those wasn't about... can't remember which
 
Reading comprehension fail, sorry
 
np :)
 
<spins Kevin's Wheel of Scapegoats>. Phone screen.
 
@JonClements finally is older. Python 2.5 unified try / except / finally, as mentioned in PEP 341. The with statement was new in Python 2.5, and is from PEP 343.
But I don't want to confuse the poor OP with try. He has enough trouble understanding that string literals need quotes.
 
4:55 PM
ahh... so else is the one that came later then...
or not... actually - I'm not sure I want to think that far back :)
 
5:16 PM
@Kevin oh, I didn't know Bezier was an option!
 
Nothing is off limits, baby
Here's what I've got so far:
All fifty of these dots follow a single spliced-bezier loop
(wrapping around the edges of the screen as necessary, pac-man style)
 
@AndrasDeak so much maths!
 
The upward-moving trend is intended behavior. The way all the points accelerate and decelerate at the same time is unintentional. The persistent gap that scrolls up is unintentional.
 
@MartijnPieters Holden?! Gotta rewatch the start!
 
The acceleration/deceleration is a known issue with Bezier curves, since the distance between successive points at t and t+epsilon is not constant, tending to be the lowest as t approaches 0 or 1
 
5:21 PM
@Kevin Bertrand strikes again
 
@Kevin it's a swarm of bees!
 
Yeah, Bertrand's secant drawing thingy immediately came to mind once I decided it was a midpoint-related issue
I toyed around with the idea of generating the midpoints from an even distribution, then deriving the actual points.
 
you need to choose your midpoint mod torus
Generate 4 more adjacent squares and find the shortest line
 
That's very close to what I'm actually doing.
 
5:24 PM
It's an interesting problem: "Draw a polygon, and find the midpoints of each line segment. Then erase everything but the midpoints. Can you re-derive the original polygon?"
I'm 70% sure the answer is "if the polygon has an odd number of sides, yes; if the polygon has an even number of sides, no, because there are an infinite number of other polygons that have those same midpoints"
The proof I drew on this cocktail napkin is non-constructive, unfortunately, so I don't have an example
 
Could be
Try drawing the circumscribed circle. The rays to the midpoints are perpendicular to the respective side
 
Here's an example for even number of sides.
 
Neat
Yeah, the circle doesn't help
 
The "draw the polygon..." problem isn't exactly isomorphic to my problem of "how do I find a polygon after I generate a bunch of random midpoints?" because it's also possible to have no possible solutions, and in fact I suspect this is almost always the case for random coordinates.
 
What are the points in your plot? The midpoints?
 
5:34 PM
At frame 1 and frame 64, the points correspond to the midpoints. In all the intermediary frames, they correspond to a point along the bezier curves drawn using [midpoint ab, b, b, midpoint bc] as control points
 
Hmmmm
 
The bezier curves are close enough to regular line segments that you could just think of them as "weighted midpoints" that interpolate their way from A to B
Hmm, I bet midpoints-of-midpoints are even more biased towards the center than regular midpoints, which would mean that the gap would be largest on frame 32, when it's at the center of the screen.
 
wim
anyone know where pypy3 is at? most recent version I could find was 3.5.3
 
At any moment I may abandon this approach entirely and do something with brownian motion
 
@AndrasDeak Yeah, that was a nice surprise, finding that Steve was the main room moderator.
 
5:50 PM
Your theory works for equilateral triangles. Therefore by induction it works for all polygons with an odd number of sides
 
@Kevin I <3 Ferrofluids
 
tiptoes away
 
wim
anyone else think this discrepancy is a little weird?
>>> c = collections.Counter()
>>> c['k'] == 0
True
>>> c.__getitem__('k') == 0
True
>>> c.__missing__('k') == 0
True
>>> c.get('k') == 0
False
why doesn't Counter override .get default to return 0 instead?
 
That... is weird
 
@RobertGrant That's about the amount of academic rigor I used in my actual proof: derived one solution for N=3, and zero/infinity solutions for N=4, then [magic occurs here] therefore the pattern continues like that forever
 
5:52 PM
Nope, because dict.get() explicitly does not use __missing__.
 
wim
@MartijnPieters So?
that doesn't mean Counter shouldn't define Counter.get
 
dict.get() guarantees that it'll not create keys. __getitem__ for Counter and defaultdict and anything else that uses __missing__ does create keys when __missing__ sets one.
 
"when __missing__ sets one", sure, but Counter.__missing__ doesn't set the key.
 
wim
__missing__ doesn't set it (thankfully)
 
@wim the semantics of dict.get are such that I'd go file a bug and fix that if Counter.get() would create keys or return 0.
 
wim
5:53 PM
I don't think it should create keys and I never said that
I think that it should use 0 as the default for get instead of None
 
@user2357112 right, worded that wrong. __getitem__ will return a value if __missing__ produces one.
Because __getitem__ calls __missing__, and .get() does not, and that's on purpose.
 
wim
I don't care if .get calls __missing__ or not. I care that it returns None instead of 0.
 
@wim but __getitem__ already does that.
 
I think wim is saying it's weird that
>>> c['x']
0
>>> c.get('x')
>>>
 
Why would .get() need to do the same? For Counter, I'd only use .get() if I didn't want a 0.
@RobertGrant yes, that's what Wim is saying.
 
5:56 PM
@wim But then what if you want get to return None? Should defaultdict(int).get('foo', None) also return 0?
 
wim
then you use counter.get('k', None)
 
wim
@MartijnPieters for consistency of return value with __getitem__
 
@wim isn't counter.get('k', None) exactly the same as counter.get('k')?
 
This seems like one of those "we can violate intuitions about the behavior of either A or B; choose one" situations
 
5:58 PM
^ that
 
@wim but it'd break consistency with the mapping interface.
 
wim
@WayneWerner yes, but there's no reason it couldn't be def get(self, key, default=0):
@MartijnPieters Now we're getting somewhere. How so? Where is the mapping interface specified?
 
@wim yes, because then it'd be inconsistent with the mapping interface. mapping[...] can return what it wants, mapping.get(missingkey) is defined as returning None.
dict is the base mapping type.
 
wim
hmm, not convinced.
the mapping interface just says the methods which should be there. and the dict docs just say how dict.get should behave.
It says you implement the get method. It doesn't say how that must be implemented.
 
Actually, it says you implement __getitem__, __iter__ and __len__. get is provided by the abstract base class.
 
wim
6:06 PM
this prevents you from sorting a list like my_list.sort(key=my_counter.get)
 
@Kevin I can't see a seam ^
this is with generate points in square -> replicate square to find torus-nearest direction -> midpoint -> mod back to square
 
Hmm. Maybe in that case my bias is coming from the way I introduce the upward motion: rather than replicating the square in all eight directions, I replicate only the north, northwest, and northeast squares.
I wanted each bezier curve to cross over the pac man boundary at least once per loop, as I found that most visually interesting
 
I replicated N, E, S, W
 
Complex is better than complicated:
https://www.youtube.com/watch?v=SoO2fJ5NmBw
 
diagonals are important for finding the absolute shortest path, though. consider a square one unit in length, containing points at (0.1,0.1) and (0.9,0.9). The fastest route from one to another is to start at (0.1, 0.1) and travel diagonally across the origin
 
6:19 PM
@Kevin or use your soon to be invented wormhole device? Or is that pending the construction of a functional LOTC still? :p
 
All my wormholes keep getting closed from the other side. Sometimes they send a passive-aggressive note through first.
 
Did you manage to Rick Roll 'em first though?
(or could it be that's why they're closing 'em... curious...)
 
"Dear Wormholer, We'd have asked that you knock first... but we thought being on the other side of the UNIVERSE! would have been enough of a clue. #CloseYourSpaceSphincter"
 
"No solicitors. Our next notice will be written in antimatter."
 
@Kevin you're right. I'll try with 8-neighbours post haste dinner
 
wim
6:35 PM
@MartijnPieters Where is mapping.get(missingkey) defined as returning None?
 
@Kevin 8-neighbours i.stack.imgur.com/91kAD.png, and with 1000 dots i.stack.imgur.com/82Iat.png
 
Ok, so midpoints can be bias-free. That's good. My midpoints are not bias-free, so there's a bug somewhere. That's bad.
 
if you only take N/NW/NE you'll get bias, right?
 
@wim mapping is defined 'whatever dict does'.
@wim: and Counter is defined as a subclass of dict with only two exceptions to the normal mapping interface, fromkeys and update.
 
Probably? I'm refactoring it to look in all eight directions to see if that helps. Some other parts of the code were built on the assumption that there'd only be the three replications, so it's not a totally trivial change
I will get to it post haste nap time
 
6:46 PM
Is this c# again?
 
Nah, it's actually Python this time :-)
 
hi folks :-)
 
+- numpy?
@PalSzabo hello
 
Hello
 
what can cause a kernel to die?
Im doing python stuff in Jupyter Notebook
and it just always dies
 
6:47 PM
What kind of kernel?
ah, jupyter kernel
 
yep
 
Dies on everything you do?
 
and core dumped, if run from terminal
no, just on a specific line
it actually uses fortran
 
out of memory perhaps, or segfault by an underlying low-level funcion
@PalSzabo there's your problem!
 
i mean the function which I call, needs fortran
 
6:48 PM
probably a segfault
 
^^ can cause the kernel to die then :P
 
ohhh
 
What is the line?
 
ft=nufft.nufft.nufft1d3(x, y, f)
 
6:48 PM
No numpy, although "do something with voronoi diagrams" is still tacked to my wall of newspaper clippings and red string.
 
@AndrasDeak yes it is exactly
i thought that if I restart everything memory returns to original state
but it doesnt
and then itll run again
 
You should wait a few hours or days to see if anyone on main will bite and answer, though your question doesn't look very reproducible.
 
@AndrasDeak yep, its not :/
 
if it really used to work as-is, it's possible you're running out of memory, I could imagine that killing the kernel. Try testing with smaller arrays
Depends on when it used to work. Earlier version? Earlier input? Earlier dimensions? Earlier this week...?
 
yes, i did for much smaller ones as well, but still dies
 
6:51 PM
I've always known the iPython kernels just keep going on out-of-memory stuff. It just locks Windows to the point that everything is impossible
 
a few hours earlier
im on ubuntu actually
 
Can you not watch htop while it runs?
 
check your memory consumption, how much is free etc.
though if it doesn't die for smaller ones then it should work I guess
Are you sure your data (jupyter state) is properly regenerated after a crash? Running every input in the right order, everything is well-defined, etc...
 
@roganjosh not installed yet but doing it now...
 
@PalSzabo: the Fortran code is compiled to a binary, and Python calls that through the normal shared library call procedures.
and if that code segfaults, then it'll take the Python process with it.
 
6:53 PM
@Kevin I can give you a numpy 5-liner for the midpoints if you want. Well one line is two lines for generating start and endpoints
 
Nothing you can do from the Python side there.
 
Segfault is still speculation at this stage, though?
 
@AndrasDeak Cool, I'd be interested in that
 
If you have the Fortran code, try to simplify it down to something that'll still cause a segfalt.
@roganjosh is it?
 
@MartijnPieters oh so should I dig into fortran?
 
6:54 PM
it's library fortran, and "it used to work a few hours ago"
 
terminal says if I run from there: double free or corruption (out)
Aborted (core dumped)
 
There you go, segfault.
 
@MartijnPieters actually I didnt write the fortran code
 
DSM
(36) dsm@winter:~/coding$ python szabo.py
*** Error in `python': double free or corruption (out): 0x000055a2b0e4b030 ***
Yep. :-)
 
Ok, now it's confirmed (unless I missed a proper confirmation earlier) :)
 
6:55 PM
\o/ :D
 
@MartijnPieters the python package needed a fortran compiler (and the licence says the hard job is done in fortran)
 
DSM
And the backtrace clearly points at _nufft.cpython-36m-x86_64-linux-gnu.so.
 
import numpy as np
# import matplotlib.pyplot as plt
start = np.random.rand(1000,2)
end = np.random.rand(1000,2)
all = np.array([end + arr for arr in (np.array([0,1]),np.array([1,0]),np.array([0,-1]),np.array([-1,0]),np.array([0,0]),np.array([1,1]),np.array([1,-1]),np.array([-1,1]),np.array([-1,-1]))]) # sorry
inds = np.linalg.norm(start - all, axis=-1).argmin(axis=0)
ends_torus = all[inds, range(all.shape[1])]
mid = (start + ends_torus)/2 % 1

#plt.plot(*mid.T, '.')
#plt.axis([0, 1, 0, 1])
 
@PalSzabo what kind of support is offered for that package?
 
6:56 PM
sorry for the messy code but I just copied that out from my REPL
 
I've completely screwed that up as a report ^^^ but I'm going to submit it to the Tate Modern and make millions :p
 
not much, this: https://github.com/dfm/python-nufft
and this: https://python-nufft.readthedocs.io/en/latest/
 
those arrays in the definition of all could be mere lists as well unless I'm mistaken
 
In 2016 there is a git issue of "is this still active"?
 
nufft said
 
6:57 PM
@PalSzabo if you can reproduce the error, perhaps try creating an issue in the tracker.
 
# sorry is the most relatable comment
 
alright
so I'll contact the package maintainers, yep?
 
In the meantime there's also this. I'm surprised I can't find it in scipy
 
@PalSzabo: two people made commits in April, both were active on Github in September. They could well respond if you post in the GitHub tracker.
 
@roganjosh yes, I was also looking for it in scipy :/
 
6:59 PM
I think scipy's fft is whatever is in fftpack
 
@PalSzabo actually it looks like they are happy with the library I just linked to, see this
 
@MartijnPieters alright, I do that .
 
They may point you to cims.nyu.edu/cmcl/nufft/nufft.html though.
 
@roganjosh :-)
 
If you can trace this back to just the Fortran package, then the author there states: Bug reports, comments: for the moment, please send to L. Greengard (greengard [at] cims.nyu.edu)
Chances you'll get a response are unknown; the last update of that page was in 2014.
 
7:02 PM
@MartijnPieters (double-post)
 
DSM
@Andras: I tried to make a "double free" joke based on that but didn't have anything.
 
aww :)
 
@AndrasDeak that's the train WiFi for you. Message goes out, confirmation it arrived never makes it back, SO chat UI in browser sends it again.
 
I figured, was just an FYI :)
mobile does the same thing for me occasionally when editing, even through 4G
 
7:05 PM
@MartijnPieters (I try it anyway, maybe)
 
What the yam? Some Perl coder just made a bunch of minor edits to my answer, and chastised me for writing a generator instead of returning a list. I assume they're also the one who gave me a downvote, but of course that's not easy to prove... stackoverflow.com/a/52383460/4014959 That'll teach me not to answer questions that have more than one language tag...
 
presumably they got angry because they could read your code ;)
 
LOL
 
> smacks of someone fresh from college and desperate for points
couldn't be more off the mark
well at least the college part :P
 
trololol. Like... you can see their rep right there -_-
Probably thinks you've been answering SO questions since you were in your diapers :D
 
7:12 PM
Perl users are deranged because the mystical pearl that fuels their powers is actually a Palantír corrupted by darkness
 
really is a weird combination
 
Interesting (about SO chat double posting). I've recently been using Firebase, that has an operation called push, which creates a key locally that is timestamp based and thus not only can be idempotent but will also sort in the proper order. Too bad SO chat doesn't use something like that I guess.
 
hence lampp
 
@AndrasDeak One really shouldn't cast their perls before herps
 
Actually, I haven't done too badly today in votes & accepts. I haven't answered any SO questions in ages. Today's the first time I've turned my computer on in over 2 weeks. My back's been terrible, and I haven't had much energy, so I've spent most of the time in bed.
 
7:14 PM
That sucks :(
 
:( hope you'll get better
 
@piRSquared don't wanna make you regret making your presence known, but you don't happen to know the json_normalize function in pandas? It's driving me nuts trying to understand the docs
 
Thanks. It's not too bad today, but still not fantastic. And I was getting sick of doing all my surfing on my phone.
 
glad to see you are here in chat then :D get well soon
 
I already gave the OP a comment that gives them something workable but I really can't understand how to make their approach work properly :/
And it really should do, I just don't get the parsing structure you're supposed to give the method at all
 
7:17 PM
I know of it. I avoid json questions. I saw a @MP answer using json_normalize that taught me something but I've forgotten it now.
 
I'm completely comfortable with JSON, but passing it to this method. Waaat?
 
wim
@MartijnPieters The whole point to subclass is to change behavior in some cases. If two deviations from what dict does is OK, why is three not OK?
 
@roganjosh I'm willing to struggle through a question if you have one.
 
wim
If my_counter.get('k') returned 0 instead of None, would you consider that a bug and be pushing for that to be changed to None? Somehow I doubt it..
 
@piRSquared I'm trying to go off the bottom example of the docs but I don't understand how the nested lists are working
 
7:21 PM
digging now
 
I've tried multiple starting points, all different kinds of nesting but I really don't get how the nested lists should just keep getting deeper for keys on the same level of nested json
 
wim
@MartijnPieters "mapping is defined as 'whatever dict does'" does not seem like a real definition to me
and it's not what the section of the docs you linked says, either.
 
@wim dict does have a pretty good spec, right?
 
wim
It does, but the doc says that dict is an example of a mapping type, not that the mapping type is specified by however dict behaviour is
 
Hello, has anyone used the eyed3 module before for tagging mp3 files? I find the documentation difficult to understand and was wondering if someone can help me?
I was trying to use it to remove existing image, but it asks me to give a parameter argument for 'description' which doesnt seem to work
code:
x = eyed3.load('file_path')
x.tag._images.remove()

Error:
TypeError: remove() missing 1 required positional argument: 'description'
Not sure where to find the description from?
Link to docs: eyed3.readthedocs.io/en/…
 
wim
7:29 PM
you asked about this earlier ...
 
@SShah if it were me, I'd read the source
because most Python source is at least comprehensible
 
wim
I think this would be a suitable question for main site
 
@WayneWerner I tried looking at the docs, but its confusing
 
not the docs
open up the source
 
@wim Yes I asked, but sadly got no reply :(, so was wondering if anyone new here could help, sorry for repeating
 
7:31 PM
import eyed3
print('open this path: ', eyed3.__file__)
That's assuming that they don't have a link to their github
 
@WayneWerner I looked through the source, and found it just as unhelpful, i navigated to the lib files and checked, I did see the class, but unfortunately it doesnt explain what I am trying to achieve :(
 
or wherever they host their source
 
This error in particular: TypeError: remove() missing 1 required positional argument: 'description'
The source doesnt explain how i can find the description for an existing mp3 file
 
So it has a description argument in the remove function, right?
 
yes
 
wim
7:32 PM
I've noticed some comment flags remove the comment immediately. Useless comments like "Thanks! that worked" for example. Is it discussed somewhere what comment contents exactly don't undergo review at all?
 
I have no idea what to parse to it
 
What does it do with the description?
does it pass it to another function?
does it ignore it?
does it send it to the NSA?
 
Well as far as I understand, its meant to remove the album art from the mp3 file
I think the 'description' itself is used to define the exact image to remove, but couldnt find a way to find out what 'descriptions' have already been used
 
You've said that much, but that doesn't have anything to do with the code because obviously it's not working. Also, unless the authors are abusing semantics, the fact that you're using _underscore_method means you're using a "private" api and you should be willing to figure out how to use it, and be willing to have the rug yanked out from you in future releases
 
7:35 PM
@wim Sure, I just disagree that having Counter.get() return 0 as a default makes sense.
 
cbg @toonarmycaptain
 
Because why? When Counter[missing] already does exactly that?
@wim it depends on the contents of the comment.
all comments can be removed with flags alone, without moderator intervention.
The number of flags it takes is variable, depending on the content and the flag used.
Some content requires just one flag.
What content requires what flags and what count is changing with need.
(I think)
 
wim
@MartijnPieters ah. interesting!
 
Search Meta for posts, I don't think there is a central public list.
 
wim
7:39 PM
I did search meta a bit but nobody seemed to have an authoritative answer
 
expletives can trigger deletion with a single rude flag
 
...just spent two days working out why Travis is failing when it works for my other project...evidently import script should beimport parent_folder.script even for scripts in the same folder, and having an __init__ in the parent_folder's containing folder (where my run_app script is housed) breaks everything too. Two days spend on this.
 
Here is another, one that I answered before I became a mod: meta.stackexchange.com/questions/196435/…
 
@toonarmycaptain is this a namespace package thing?
 
@piRSquared I give up on that. I'm just going to avoid the method beyond its basic application. If you get bored and manage to solve it then you will slaughter a niggle, but I am defeated :)
 
7:46 PM
Still at it. I'd like to have this in my tool box
 
The simple application is super easy and really convenient. The syntax beyond that needs defining more in the docs
If you crack it I think it's an instant PR to get it in the docs, because that JSON should be sufficient to illustrate exactly what's going on
 
I have asked my question on the main site, hopefully I can get some answers there, sorry to disturb you folks, and thank you for your support :)
 
@AndrasDeak I guess? Travis kept saying it couldn't find the modules to import.
 
wim
@MartijnPieters I gave already an example. my_list.sort(key=my_counter.get) can cause TypeError: '<' not supported between instances of 'int' and 'NoneType' that would be avoided if Counter.get was defined to be consistent with the return value of subscription for missing keys
@MartijnPieters What is an example use case where Counter.get returning None as a default would be more useful?
 
Consistency with the far-more-common dict.get()?
 
7:57 PM
lists and tuples don't have a get method either and nobody's complained about having to use operator.itemgetter instead of tuple.get
 
wim
But they don't need to define .get.
Counter does, since it's a mapping subclass, so it may as well define it the most useful way possible, right?
 
Regardless of the behaviour, I'm not sure why the discrepancy, as you see it, is such a bugbear
 
DSM
bash.. but calling Python to do arithmetic! Today's a little strange..
 

« first day (2894 days earlier)      last day (2053 days later) »