« first day (2855 days earlier)      last day (2316 days later) » 

00:18
pst evening cbg. not my usual time, but...
cabbage!
o/ @user3483203
I believe that tonight is the night I break into the All Time Top 5 Pandas Askers (-:
Planning on posting another canonical? :P
00:31
I have 2 in mind but I haven't had time.
Top 5 in both answers and questions, that's impressive!
 
4 hours later…
04:58
Top 5 Pandas Asker Achieved! stackoverflow.com/tags/pandas/topusers
Congrats!
(-: thanks.
05:34
Who will reign supreme? The chained methods with regex or... the triple nested incomprehensible comprehension?
Lol my eyes are hurting looking at this question
Is someone playing with markov chains?
Must sleep rbrb
rbrb \0
cbg nice and gentle people
 
1 hour later…
07:09
cbg
07:25
whats up guys
08:05
Can someone check my question: stackoverflow.com/questions/51781028/…
?
08:34
Hello to all..... I want to know whether anyone knows how to display the refreshed plots on jupyter notebook using matplotlib.... Here is the code I have tried:
The code shown the output at the last and no middle images are shown.
Here is the question that I have mentioned:.stackoverflow.com/questions/51782083/…
Can anyone help me in that?
@AbhijeetPanwar Your question is perfect and looks good to me. The question belongs to Django framework. You can move to Django Chat room and discuss it there. Will help.
 
2 hours later…
10:39
@AbhijeetPanwar we ask that users don't ask for help with their fresh questions, see our room rules sopython.com/chatroom
11:06
Already voted :(
11:57
nitty-picking: but it's more of a logical error than a typo yes?
"brain fart" kind of typo, what matters is "unlikely to help future readers"
agreed
.... oh. I er.. already had cast a close vote too apparently...
glad to see that two days past me arrived to the same conclusion...
12:46
Hmm, having a hard time determining whether SOPython has a dupe target for Can you import another script from a variable?, because searching for "import" returns basically every question in the common questions list
oh yeah, I've been meaning to mention that you don't seem to be able to search in titles (or was it excerpts? probably excerpts)
or was it tags
Who upvoted the objectively wrong answer :-I
facts are in the eye of the beholder
or something else.
la li la looo
please refrain from making remarks of sectional nature
12:51
Surprised nobody has answered with __import__(foo) or exec(f"import {foo}") yet
(I was joking :|)
I haven't because I'd prefer that the OP give up on this particular line of inquiry. There is no honor among Kevins.
@FélixGagnon-Grenier that being said you'll never know what makes you end up on the factory building welcoming wagons 24/7 :P
heh, indeed, gotta be careful :)
12:55
Every company wishes their code of conduct was "don't make us look bad" but paradoxically it would look bad if that was their actual code of conduct
Greetings
DSM
DSM
13:41
Morning cabbage.
I hope everyone's carrier pigeons are still pigeons and not spoons!
Cabbage
There isn't a good OOP way to make composite objects on a tkinter canvas, is there?
>>> len(pigeons)
0
>>> all(pigeon is not spoon for pigeon in pigeons)
True
Phew
@ReblochonMasque I had that problem a while back. I couldn't come up with an OOP solution.
Yes @kevin, I've spent quite some time looking into it, and I did not find much outside of tagging objects and doing the accounting by hand!
I don't think it's impossible, mind
There seems to be a Group class but I did not find the code
13:52
I guess it depends on what you actually need to do with the objects. If you only need to create them, then you can subclass Canvas and write your own create_whatever method.
I actually have some ideas to subclass tk.Canvas, and make it OOP, with some sort of Model Hierarchy tree to group objects
I would like to discuss this with someone more experience and knowledgeable than I am; would that be something you would be willing to discuss with me to establish some sort of design guidelines - At a time convenient to you, that it.
I think I need a bit of reassurance that I am not completely off base in my analysis of how to do it.
You can of course reply later, and we could tentatively start a discussion just to see where that could lead to; no hard commitments to anything, just maybe bouncing off ideas
I've got some free time now. How are you thinking of structuring this?
I would like in fact create canvas objects on which methods can be called on later.
Something like `item = create_composite_item(canvas, ...)`, then later call canvas methods on it like `item.dothisandthat()`
doing away with tags and ids on the API/cliend side.
Hiding all that accounting machinery inside a canvas class
Yeah, ideally you shouldn't need to interact with ids at any point
14:04
@DSM herd of cows...ouch
I wonder if it's even necessary to subclass Canvas. If you create a class for each kind of canvas item, then you can make each one of them responsible for handling their own "primitive" version of themselves
Then they get a canvas reference and act on themselves by interacting with it? Is that what you think?
class Line:
    def __init__(self, canvas, **options):
        self.canvas = canvas
        self.id = self.canvas.create_line(**options)
    def delete(self):
        self.canvas.delete(self.id)
    #todo: implement other things that do this and that
Or, hmm, maybe it is a good idea to make a Canvas subclass, if you still want to use the tag system
Yes, I've played with something like this too... like your Line class, with a subclass of Canvas.
It works also with items composed of several primitives, as long as they are handled as a group.
Mm hmm, pretty textbook use case for the Composite pattern
14:13
cool, thank you. you've soothed my worry that I was on the wrong path.
I have to run, it is time to take the dogs out, they are making a ruckus here... they have a little clock inside!
@ReblochonMasque pro-tip: Stop feeding your dogs clocks!
I will try to put something together and that would be great if I could run the prototype by you.
Thanks @piRSquared... the more you feed them, the more you pick up! :D
brb
@ReblochonMasque that's partly why I vote against DST
Then again you seem to be in China :)
@AndrasDeak We had an official opinion-gathering from our government on that matter in germany a couple of weeks ago, you had one too?
@Arne that was EU-wide, not only for germany
14:19
Hey @piRSquared, thanks for the help with my fixed width file question yesterday. I've noticed that your solution:
I'm afraid as soon as I read the "press here if you think DST is bad" I went full Hulk and just smashed
fmt = '{year:4.0f} {day:3.0f} {radn:5.1f} {maxt:5.1f} {mint:5.1f}
{rain:5.1f}'.format_map
with open('my_fwf.txt', 'w') as fh:
    fh.write(df.apply(fmt, 1).to_string(index=False))
@ThiefMaster jup, that was the one
Please sign my petition to encase all human settlements in enormous opaque domes, each one having an artificial sun that traverses the same arc in sync with every other dome's sun. Thus solving all time zone problems forever.
Is better than all of the answers to the highest voted question regarding this issue here: stackoverflow.com/questions/16490261/…
posting in chat is hard LOL
you may want to add your solution
14:23
(-: thx @W.Dodge I may add it
@Kevin we could also try to tide-lock earth, that might be simpler
Dibs on the thin strip of land that won't be boiling or frozen
@Arne so many bad things! #1 No more tide pools
Good thing: Pink Floyd could write the long sought after sequel "The Dark Side of the Earth"
we would still have tide though, the moon is still free to do his thing!
qed: project tidelock earth has no downsides
^ convinced!
14:31
But tides require liquid water, which will be hard to come by
For the statement a = round(2.0, 2) I am getting 2.0. But I need 2.00. How to achieve that?
2.0 and 2.00 are the same value, as far as your computer is concerned
I was imagining the moon also tidelocked on the other side in a perpetual lunar eclipse. But I see that my imagination was running ahead of a earth tidelock reality
DSM
DSM
If you need to track precision like that, floats are the wrong type for you.
Yes, but the tutorial in hackerrank won't let me pass
14:32
Rather than fretting about how the value is being stored, fret about how it's displayed to the user. I think there's a format specifier for that.
f"{2:0.2f}"
@piRSquared umm, sorry to sound such a noob but how do I use that?
As in, "how do I take that value and print it?"? print(f"{2:0.2f}")
fmt = '{:0.2f}'.format
fmt(2)

# 2.00
14:36
I have a bad feeling we're going to find out in ten minutes that Hacker Rank is still using Python 3.5
What is DST @AndrasDeak
@Kevin SyntaxError: invalid syntax
I'm not AD, but DST ist daylight saving time
That was faster than I expected
Lol
@Rishab the f-string syntax is Python 3.6+
14:37
f strings are a newish feature so you can't always expect every programming challenge site to support them
Try the other thing I posted
hackerrank.com/environment confirms that they're using 3.5.2
I actually don't know if china has it, maybe they got rid of it together with having multiple timezones
Man, my crystal ball is really clear today
DSM
DSM
I admire you using your powers only to help people with code questions. :'-)
14:39
Does it count as insider trading if I give stock tips based on my exclusive knowledge of the future?
If we could figure out how to harness Earth's angular inertia, this could power humanity for a few 100,000s years... slowly slowing the rotation down until tide lock.
friday cabbage
That would make a day 8760 hours long, I could get so much done in a week
ahhh Daylight Saving Time... LOL who still cares about that :D
@piRSquared ok wow this worked. Although the syntax is deadly :D
though i guess it wouldn't make a difference in our lifetime but someone eventually would have fun with that
14:40
The Long Earth series uses "let's use the Earth's spin as an energy source" as a plotline. Hijinks ensue.
No DST in China, and only one time zone... so get up early, some go to bed late. The population must adapt!
and on the other end of the spectrum is Eucla, Australia, sitting at GMT+8:45
Adapt to quietly ignoring the wall clock and going to bed when you're tired like always
@Rishab here is a reference to the format spec mini language docs.python.org/3/library/string.html#formatspec
Or the cheatsheet that needs a cheatsheet wiki.python.org/moin/FormatReference
Thanks for your input @kevin, I feel validated in my thinking! :)
15:01
@ReblochonMasque I only mentioned it because clock-aware companion animals go nuts for a week with each switch
ah, ok, thanks, that makes more sense now., thanks @AndrasDeak
15:16
Dnago, most popular web framework for phyton
System Error : bad argument to internal function: you know something has gone horribly wrong when range(4) crashes
Fully expecting the reply to my comment to be "sorry, the line in question is ten layers deep in some code I just installed, I have no idea what it's doing"
DSM
DSM
While waiting for today's pizza to arrive I made the mistake of writing an answer to an underspecified question. Guess what happened next! (sigh)
Attacked by wolves? Earthquake? OP replied saying "that's not what I meant" and/or "thanks, but one more thing..."?
@Kevin Perhaps non-cpython?
Perhaps. Objects/listobject.c:169 in the cpython source doesn't seem to have anything to do with range.
15:23
Or range is shadowed...?
That error message creeps me out
Usually in the case of shadowing I'd expect TypeError: int object is not callable or something similar. This doesn't even look like a real Exception.
15:44
PyErr_BadInternalCall. Is this when a computer is haunted?
@Kevin i dont have that example yet , i will try to recreate it , because sometimes this code works abs fine . will update here once i have the example code . thanks — Kiran 7 mins ago
Heisenbug. This is getting better and better.
16:11
def heisenberg(*args, **kwargs):
    if random.random() < .5:
        raise ValueError('Wrong Arguments Passed!')
    else:
        print('That went fine.')

heisenberg()
16:25
rbrb
stackoverflow.com/a/51789353 low quality extract from a better answer, which doesn't answer the question
cbg all o/
@Kevin second soundtrack for Hollow Knight released on Bandcamp: christopherlarkin.bandcamp.com/album/…
16:39
Nice, I think I'll give it a listen now
I'm divided between three different Metroid-likes on Switch right now. Iconoclasts, Hollow Knight, and Axiom Verge. No, I couldn't manage to finish one before buying the next.
Hollow Knight <3
I recently started Momodora and I died about eight times in the tutorial forest
Finally a loveable bug
High difficulty + plot line about a decaying world + rolling with iframes -> MetroidVaniaDarkSouls
I just finished Hyper Light Drifter, which is also a difficult game taking place in a decaying world where you have to master the dodging mechanic... Hmm, I sense a pattern
16:48
I have Hollow Knight for steam and love it
I should probably play actual Dark Souls at some point
wim
wim
16:58
Anyone tried integrating black with PyCharm?
I don't know what black is in this context and I don't think google is going to help me out
I was half-wrong, I found black.readthedocs.io/en/latest eventually
wim
wim
yep, that's it
17:14
black is a formatter (there is a plugin for PyCharm but I've not used it)
wim
wim
I've been writing a bit of go lately and since go formatting is opinionated (think PEP8 compliance or SyntaxError), the jetbrains editor - "GoLand" i.e. PyCharm for go - just formats it while you type.
Surprisingly pleasant.
I was using GVim for some quick hacks this week and realized "I used to love just loading up VI/VIM for some quick hacking but IDEs have ruined me"
hmm...I answer a question with three methods and explanation and no upvotes. Another person answers the question, with code that doesn't run at first (then doesn't actually answer question), and one upvote......people are mysteries
17:32
Looking at doing something on unix that I thought some people in this chatroom might know how to do. Anyone have any thoughts? unix.stackexchange.com/questions/460907/…
Hmm, thought it would give a preview. Anyway looking to start a root service from a GUI in a python application (linking in with dbus)
wim
wim
What to do when an answer arrives some years later, and it's not incorrect, but it's exactly the same as an already existing answer (on the same question)? Downvotable, or let it be?
Qualifies as "not useful" I reckon
@wim Little fish here, but that sounds like a downvote to me. Sounds like they are fishing for points.
@DonyorM Normally I'd suggest the subprocess module but I don't think you can use that in a non-root-privileged program to start a root privileged program
wim
wim
@DonyorM Impossible
You have to pop up a dialog or something asking user to enter an admin password
17:37
If exact (or exact enough to count as plagiarism), downvote and flag/close vote. If just "dude, someone already said that", just downvote
Come to think of it, wouldn't any kind of privilege escalation of that nature be bad
@wim that's what I figured, but how to do that in a secure manner? I'm new to this, but my understanding was that GUIs were inherently insecure.
wim
wim
You can't do it
@Kevin yeah, I'll edit the question. I do want the user to input their password, but not even sure how to do that in a secure way
wim
wim
By the way, Dropbox got into trouble for trying to spoof the admin pop-up dialog
they made it look like the native macOS admin dialog, but they saved the password
17:39
sounds phishy
wim
wim
yes, basically phishing
@wim So how would something like gparted work then? It inherently needs root access but equally needs a gui. My understanding was the best solution was to make a background service with root permissions and communicate to it from the low-priveliege gui program via dbus and authenticate with policy-kit. But I can't have my users starting the root service with CLI, I need to start that via a GUI too
Use the same model as windows -> "Hey, you want to do this thing which takes admin priv" -> Open non-bypassable message "Login as admin" or "enter admin password" -> then only use that permission for that act or set of actions and then return to previous permission setting & don't ever save the password
@wim Nice bit of social engineering it sounds like
.......or basically what wim said (why am I so slow today? :\ :)
17:41
@wim Do Linux systems have a way to make an admin dialog? My understanding was something like gksudo or pkexec where the best, but those seem to be considered bad practice as well. I have found very little information online about this, hence the low-level questions. Trying to do this in a reasonably secure manner (and avoid the Dropbox phishing issue)
wim
wim
Not linux itself
sudo -S might be useful?
wim
wim
Even sudo is a program
The desktop environment may or may not provide some features like that, but imo gksudo etc are evil
I know. That's why I'm looking for a better solution. Are you telling me that without the command line, there is no way to make a GUI administrative program?
@wim if it's exact enough: flag for mod deletion
17:45
@MoxieBall that is useful, thanks. Still need a secure way to enter the password via the GUI, but that may be more achievable.
At least a more narrow question
This seems like the kind of thing that there ought to be a way to do
su-dough or su-doo?
It's kinda important if linux is to be used by anyone other than power users.
I shared this in a couple places besides here, if I don't get answer in a couple days I'll make a specific question on StackOverflow using MoxieBall's suggestion. I should be able to use sudo -S so long as I can get the password securely.
wim
wim
GUI processes run as user
they have no business running as root
@DonyorM btw. a lot of people (I mean I just saw someone fired for this like this month) get in trouble for messing with WindowsIdentity or PrincipalPermission within a Windows environment so there's a reason they (other OSs) make it harder
17:48
They even mess up your $HOME without gksudo
....disabling the UAC to run something as admin. 'Twas asking for someone to destroy something
wim
wim
@AndrasDeak not sure if exact enough
@JGreenwell that makes sense. I'm asking this question because I want to do it right. At this time I have the program running as root as GUI, but that's terrible security practice and won't work at all in Wayland. I just have yet to find a good article or tutorial explaining what the alternative is an I'm utterly confused.
wim
wim
it's a copy of my answer, but with 3 syntax errors and a bug. here.
I'm not saying you can't create a GUI as an "interface" for users, but root stuff should run as separate process (in Linux or MS actually)
wim
wim
17:52
@DonyorM I would downvote your question, but I don't have the rep on unix stack exchange. You didn't even specify what privileges the program needs, and why.
How do you expect useful advice other than "don't do that" if the question is basically "I want GUI program to run with root"
What does it do, which parts need a privilege escalation and why, is it a temporary once-off escalation, these are important details
Also relevant: how/by whom/where is the daemon and/or GUI installed
As an example, the last time I had to do that (load something with non-admin but elevated permissions in Win), I did a Process.Start(otherprogram.exe -WorkingDirectory path_needed -Credential ($credentials)). User didn't even notice anything except they had to provide the credentials and GUI didn't touch the stuff that needed elevated perms - to their perspective it was all the GUI
@wim Thanks for asking specific questions. I'm sorry I'm having trouble articulating what I need, but I honestly have no clue what would be helpful because I have no experience with this. I'll edit the answer, but here's the quick answer to your question. It needs escalation for disk partitioning and filesystem formatting, once it has done this it's simply a backup program copying files with rsync.
The program is a normal program presumably installed as an administrator via a package manager of some sort (pip at the moment, but hopefully distribution package managers in the future)
@JGreenwell that would work, but under Linux systems apparently even making a dialog to receive a root password is considered bad security (if I understand what I've read elsewhere, wim seems to agree). Otherwise I could probably do that.
Incidentally I'm pretty sure question previews in chat only work if you paste the url by itself in its own message
That makes sense, good to know for the future :)
18:08
@wim if it needs domain knowledge a flag will probably be declined :(
If that answer were syntactically correct I imagine it would be exact enough
yeah, following those steps for admin/root, and saving passwords & full credentials, was what led to the whole DropBox incident. Hence Linux is smarter than MS and is telling you for a reason to avoid this :)
cabbage
@wim on that answer: I'd vote for (and am) just downvoting - he copied you and didn't even write correct code (hence not really "copied") let him just reap the downvotes since we don't have a flag for "Its just wrong"
18:18
@JGreenwell yeah, just MS (apparently the dropbox issue was on Mac too, which is closer to linux in this case I think) has UAC when you need to do one or two things with root. I haven't found a linux equivalent. Apparently the best way is to run a daemon from start-up, but unless I misunderstand daemons (which is very possible), this seems like a waste of resources for something that won't be run frequently.
Would be nice to have a "It's just wrong" answer review queue that could be audited by users with a certain level badge on tags in the question
Does that then send him into the "negative" for rep where they have to work even harder to get some?
@ZackTarr nope
DSM
DSM
18:52
Three times in the last few hours colleagues have asked me SO-style questions. All this practice really is useful!
19:02
Did you close them?
DSM
DSM
Closed them with ANSWERS!~
were they duplicates?
@wim flagged it anyway
19:26
recbg
wim
wim
19:51
huh, the term "coroutine" makes so much more sense if you remember that "subroutine" is a synonym for a function/method.
DSM
DSM
GOSUB was how I thought you called a function back when I started programming..
when I started programming, gosub was used for siubroutines.
Functions were named fnX and you defined them with def
20:07
@AnttiHaapala "Tell that to young people of today and they don't believe you"
20:20
I remember working in Basic so fondly....I do not remember Basic itself very fondly
Cabbage. We didn't have named functions in the 1st dialect of Basic that I learned, just gosub. And of course there were no statement labels, just mandatory line numbers.
On a scale of 1 to 7 alligators, how obnoxious is this:
print(*map(lambda x: eval("f'{A:< 3} + {B:< 3} = {A + B:< 0}'", x), [dict(A=1, B=2), dict(A=5, B=-1)]), sep='\n')
My first basic was Basic 7.1
Basic was ok, back in the day. I probably used around 20 different dialects over the years. One of the nicest was on the Amstrad, I vaguely remember it having pretty advanced graphics capabilities for the era, and its graphics system was well-designed.
@piRSquared I'd use getrandbits(1) rather than messing around with floats.
20:33
Ok, I'll update my production code (-:
DSM
DSM
Are alligators known for their obnoxiousness? I feel like there's a reference here I'm not getting.
I'm attempting to choose a completely arbitrary scale
DSM
DSM
Attempt successful.
I should've written GOSUB in that earlier message. Everything was uppercase. I didn't see a system that had lowercase chars until I'd been programming for over 10 years.
hmm...trying to remember when COBOL started allowing lower case
I remember that being fairly recent (meaning in 2000s) - but that could have just been the policy at the company I worked at
20:38
@DSM common confusion of alligators and gharials
getrandbits is cool. And it's efficient. IIRC, all the random number functions eventually get their bits from it (or more precisely, from the underlying C function), so it makes sense to call getrandbits when appropriate.
I hit the jackpot on SE.Physics. I managed to answer a question that went to the HNQ, and I've hit the rep cap 2 days running. physics.stackexchange.com/questions/421957/…
wim
wim
Are there any Top 5 Pandas Askers in the room?
I'm here
wim
wim
Could you ask them why they only want to eat bamboo? Seems detrimental to the species
How many downvotes would that earn you think?
> This is an easy experiment to perform, using some light thread and a few nuts (the metal ones, not the edible kind :) ).
That's cute... edible nuts is not where my mind went
20:53
You could do it with edible nuts, they're just harder to tie onto the thread. :)
Life likes simply connected stuff
I'm a little surprised that I got the top score on that Physics question. I was the 2nd to post an answer, and the answer that now has the 2nd-highest score was the winner until we got to the 20 upvotes mark. I guess the HNQ crowd just liked mine better.
@piRSquared you were correct, on very large dataframes a simple for loop ends up being faster than broadcasting
I suppose I should create a nice ray-traced diagram for that answer. I wrote some POV-ray stuff about 15 years ago that does very accurate catenaries, given 2 points on the curve & the length. E.g., i.sstatic.net/osoqn.png
Actually, the curves themselves are perfect, but I don't bother ensuring that each link of a chain is perfectly following the law of gravity. That would be rather tricky!
21:19
@user3483203 I think broadcasting makes for slick answers. But rarely does it provide the best time complexity.
wim
wim
quick poll, what do you prefer (they both do the same thing):
@pytest.fixture()
def myfixture(...):
    ...

@pytest.fixture
def myfixture(...):
    ...
1. has consistency with fixtures that accept arguments. 2. has.... less typing?
first one looks like less magic
but I'm liable to change my mind
@wim Is it only about omitting parantheses if they aren't necessary?
if yes, i'd favor consistency with class definitions omitting it instead of it looking as if it takes parameters
and the same as the dataclass decorator in its pep usage examples
21:36
pd.read_csv(..., index_col='year') explicitly says to drop 'year' as a column and use it for row-indices [doc]. What to do with the latest asking?
Can you post the question it's a duplicate of?
@user3483203 No, I said near-duplicate in my comment on the question. Questions on pd.read_csv(..., index_col) are pretty garbled. Not sure want to make this one the primary target either, because the pd.read_csv(..., index_col) may be unnecessary; the OP's intent and answers may sidestep it. See my edit to the code. (Do we answer the OP's stated question as-is, or the intent of their code? If the latter, it is not a good primary target for index_col)
There are 1658 pandas questions mentioning index_col. Lotta working sorting and triaging those.
wim
wim
21:53
@Arne the dataclass decorator also has the same "feature"
so it not clear to me which you're saying you prefer, 1 or 2?
this is kind of annoying imo. We don't allow a shortcut to call a function foo(kw1=1, kw2=2) like just foo so why should the case of a decorator-maker be any different?
Also, pd.read_csv(..., index_col) has been accepting string or list-of-string for some time, but the doc has never been updated to say that. Also a docbug.
Would definitely be worth submitting a PR
If a question title is badly inaccurate, should we fix it to reflect the actual question or leave it like this so it may help some other user that uses the wrong but same terminology?
I'd say definitely fix it. No way to predict what people will search for, better to have an accurate title.
22:08
@wim I prefer two, but only because I have not real opinion and it seems suggested by the pep.
@user3483203 I agree with that when its badly inaccurate. Where would the line be though?
I would feel strongly against functions allowing the omission, because I associate function calls so much with parantheses
@OlivierMelançon I think the title should always be made as exact as possible. The onus should be on people searching for answers to correctly learn the terminology of what they seek.
happy weekend everyone, rbrb
22:23
@smci posting a question as with no actual dupe suggestion is...suboptimal
@OlivierMelançon is the question still open?
@AndrasDeak Yes it is, I don't thinl it was a duplicate actually
@wim It shouldn't be. And the stdlib doesn't do stuff like that, afaik. E.g., you have to write @lru_cache(None) even though None is the most common arg.
isn't that because lru_cache is a function rather than a class?
does the interpreter just check type(decorator) and instantiate it if it's type?
functools.total_ordering says no docs.python.org/3/library/…
@OlivierMelançon If the question is active, encourage the OP to fix the title, offering suggestions if necessary. We want to train OPs to do the right thing themself, not to expect us to clean up their messes.
Fair point
22:37
@OlivierMelançon OK, the reason I asked is because (newly) closed questions shouldn't be edited unless the edit makes them eligible for reopening
I know wim hates it but the functools examples have plenty of parenthesisless decorators
And if the question is ambiguous, like that dupe counting one, definitely don't change it until the OP clarifies it.
I already had changed it before you pointed out that there was a second ambiguous point :/
Was that a correct use of the past perfect?
@AndrasDeak A simple decorator takes one arg: the function (or class) that it's decorating. Fancy decorators that take parameters are more like decorator factories that return the real decorator that does the actual decorating. So having a decorator that can be written either with or without args is confusing. It looks like a simple decorator, but it really isn't.
And explicit is better than implicit.
I get that. My point is that there are plenty of examples to this duality in functools, such as fun.register in docs.python.org/3/library/…
22:48
@OlivierMelançon Ah. :) Incidentally, when I first saw that question I was just going to educate the OP about the difference between "array" & "list". But I got caught up in commenting on the answers instead.
@PM2Ring Good thing though, your heads up helped me improve my answer a lot
@AndrasDeak Ah, right. I see what you mean. I'd never noticed that before.
@AndrasDeak a) I already showed the 1658(!) pandas questions mentioning index_col In sorting and triaging those there will be dupe target material. b) In my comment on the question I said near-duplicate, which it certainly is. I don't know what tag I'm supposed to use here in chat: ,...? c) and I read multiple versions of pandas source and doc, then filed a pandas docbug
no tags at all
the only ones we endorse are ,
(I'm not even sure we endorse for posts missing the generic tag)
22:54
@AndrasDeak That's different to other chat rooms I participate in. Does each room have different conventions? You don't think is useful?
Yes it is, they do; no I don't
technically that would be but still no :P
@OlivierMelançon No worries. I'm on my phone, so it's a bit painful to write answers, but it's nice to be able to offer suggestions. Although some people tend to delete their answers rather than improve them. I guess that makes sense if you realise that the only way to fix your code will turn it into a clone of an existing answer.
@AndrasDeak saying that something is wrong without saying what the right alternative is, is equally suboptimal. "No tag" seems suboptimal as the transcript cannot efficiently be searched.
you're the only one who would search for that
@AndrasDeak No I'm not. How according to you would people efficiently extract a list a of issues needing discussion from the transcript?

« first day (2855 days earlier)      last day (2316 days later) »