« first day (2721 days earlier)      last day (2226 days later) » 

wim
12:02 AM
Haha. Safely, except when it crashes the Python interpreter. Nice.
 
Unfortunately, I think if you call it a "list display enclosure" people will have no idea what you mean. Plus, the compiler source still calls it a literal, last time I checked, even if they fixed the strings exposed through the ast module at some point, which now just helpfully tell you that a List is a list.
 
How to update time? is another one of those question titles that really should be more profound. Like "I found this flying diner, but every time I try to use its Python interface, I end up overwriting time instead of updating it, and Clara threw out the instruction manual."
Yeah, even -1 isn't a literal, it's a UnaryOp.
The - in 2.3e-4 is part of a literal, but not the one in -2.3e4.
For even more fun with complex literals, if you can dig up an old enough 2.x version, 2j is a SyntaxError, but 1+2j is a BinaryOp adding two literals, one of which you're not allowed to type as a literal.
 
you should review your definition of fun
 
wim
The last time I went down that rabbit hole I found a bug in the tokenizer
 
12:13 AM
Did you file it on b.p.o? Because it's still in there in 3.7.
 
wim
no its not
 
Ah, the bug was that 1 doesn't work, not that 1j does work.
 
wim
yup
 
@FlorianMargaine True, it's not that much fun; he's not even building frame objects and passing them to the interpreter via ctypes.pythonapi functions or anything.
 
wim
signed zero better at least be "fun" because it's an abomination in every other respect
 
12:17 AM
Conventionally, what is sign(0)? My intuition says it should be 0, or in the event that 0 isn't a valid sign, 1. However, I've seen places where sign(0) == -1.
 
It's 0 for most uses. Wolfram Alpha doesn't even give alternatives.
I once used a C library with a floatsign function where negative was TRUE (1), positive was FALSE (0), and 0 was 2.
 
sign(0) becomes particularly important in binary classification problems in ML
especially in those cases where the labels are -1 and +1 only, sign(prediction) will result in one of those two labels unless prediction == 0.
In that case, it becomes necessary to disambiguate, and it could go either way.
 
In the handful of traditional engineering uses where you actually want +0 and -0, you want their signs to be +1 and -1, which of course IEEE signed zero doesn't give you.
 
wim
don't get me peeving about IEEE 754
idiotic errors of electrical engineers ...
 
12:50 AM
At least the 2008 version doesn't have things like a 128-bit format that must take either 108 or 135 bits, not 128.
 
wim
Should this be hammered to this?
 
@wim I'd say yes. From what I can tell, it's exactly the same issue, and the answers look pretty similar.
late night/early morning rhubarb
 
Ideally, I think, you should edit the info in MSiefert's answer into Veedrac's answer to the other question, and then dup.
 
1:26 AM
@abarnert In fact, I don't have access to almost anything other than google search and stack overflow
The user icons don't even render :P
 
1:47 AM
I am at wits end, for some reason when I assigned my static_root in my django project i lost the ability to embed the videos I have saved inside of there
 
2:36 AM
What is this syntax as depicted in this answer?
import module:, I've never seen it before
 
Who upvoted that?
 
Okay, so it wasn't just me. Well, the upvote can be fixed, done.
 
3:09 AM
cbg all
 
@shuttle87 cbg
 
So I'm writing a bunch of statically generated sites, some with Python tooling like Pelican and some with nodeJS. I really want comments that aren't Disqus, anyone know of a good way to do this, preferably a Python comment engine I can host
Is posativ.org/isso any good?
 
3:25 AM
Is the "not Disqus" requirement about its UI, its functionality, its license, its general corporate evilness, …?
 
The licence/tracking are a big negative for the clients I'm working with
The UI is fine, it's mostly just the off-site hosting that's an issue
 
Isso seems to make a point of the fact that it's not scalable. "Why SQLite3? … If you manage massive amounts of comments, Isso is a really bad choice."
 
Hmm that's awkward to say the least
 
Do I get free rep on SO if I mention Discourse as an alternative? :)
 
Hey
 
3:31 AM
IIRC, Discourse hosts for small-to-mid size, but if you're big enough they'll offer to give you a special instance, or sell you a support contract and help you set up your own instance.
 
I want to know , how do you call your SQL in python api? and I always repeat something in my SQL part, I guess there are may have better solution, don't need to try ...except .. rollback in every functions..
 
Why are you posting a screenshot? Are you looking for comments on your editor color screen? I grew up with green-on-black monochrome monitors, and I honestly don't get the nostalgia kick people who never even saw one have for emulating them.
5
 
No , just show the code which I have write in my editer .
 
github.com/adtac/commento this looks interesting
@FrankAK please don't post screenshots of code, this is something that is quite annoying honestly
 
I see database_sqlite.go there, which implies they're aiming at the same range as Isso, even if they aren't actually bragging about how unscalable they are.
 
3:37 AM
Sorry guys! I keep it in mind
 
What scale are you looking for?
 
Well that's the thing, mostly small, but I'd rather not have catastrophic failure if there's a lot of page hits
 
If you're not using a hosted service, that pretty much means either buying way more capacity than you need or can afford, or being able to scale out to large numbers of cloud instances and get hit with a whopping big bill the first time you get /.-effected or DDoS'd.
 
I already have excess server capacity with which I can run this off, thankfully
 
OK, I think I've misguessed your idea of "a lot".
 
3:43 AM
@abarnert (made me chuckle)
 
ok guys, I have these in my settings.py (django)
STATIC_ROOT = os.path.join(BASE_DIR, "static/")
STATIC_URL = '/static/'
MEDIA_ROOT = STATIC_ROOT+'media/'
MEDIA_URL = 'media/'
 
But yeah I'd more than happily pay some service for the comments, it's just that that comment service can't inject random trackers and ads. A lot of hits would be more from spammers or something rather than readers, so it's a bit hard to quantify because the actual traffic from real people wouldn't be that big.
 
I'm trying to take a video in here and play it on my page, file is locatd at
/static/media/media/fl100.mp4
 
@Skyler this is a bit of a nitpick but I'd suggest being consistent with the use of os.path.join here
 
and this the previously working video tag
<video width="100%" controls>
<source src="/static/vid/fl100.mp4" type="video/mp4">
<!-- <source src="movie.ogg" type="video/ogg"> -->
Your browser does not support the video tag.
</video>
for the source line I've tried changing it to STATIC_URL, hardcoding /static/media/media/fl100.mp4
 
3:47 AM
So there's a good reason to use the static template tag, it will point links to the right location
 
STATIC_ROOT and MEDIA_URL
but none have worked
 
The URL in your HTML is pointing at /static/vid rather than /static/media (or /static/media/media).
 
that was the old (working version), prior to me assigning static_url and static_root and copying the assets to the right folders
I've looked that though I admit I'm a tad confused about static_root vs staticdirfiles
 
Also, your endpoint is /static/media, and your file root is likewise $BASE_DIR/static/media, but your file is in static/media/media?
 
3:51 AM
that part has been confusing me as well
basically the asset videos can be uploaded via the admin panel since they tie in with the DB
and it sends them to a folder media inside the media_root
so after static/media didn't work i did static/media/media to avail
 
insert coin
 
in a nutshell: I've been trying to unbrick the video player ever since I assigned the static_root and static_url
I originally had my admin panel css not render either and it took a while to get that up and running
videos are still being a problem child
 
Static files have to be handled with the url router, are you doing that?
 
I might be without knowing the name, are you referring to url.py
urls.py*
such as
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
 
That looks like how you'd do it for the development server, I don't think that's the way to do a deployed site however
 
3:57 AM
hmm, i still havent even gotten it working on the dev server though =(
 
oh :(
 
its been a bad bricking
@shuttle87 that being said, i dont have a staticdirfiles, only static_root
can that be contributing to the problem here?
 
I think you need to have that so that Django actually finds the files
 
4:20 AM
I am curious, how often most people here use python at work. I was browsing through python jobs in my area and most of the job descriptions list python as an "additional requirement" besides the main language for the job which is mostly Java, C/C++, C#
 
I use Python all the time
But that's likely because I doing consulting with Python and the business I run also uses Python
I sometimes use C# and C++ also. Trying to avoid Java jobs mostly.
 
Good to know. I wonder, how much of the time people actually work with python when companies list it as a "preferred skill"
 
independent contracting work, python
my own business, python
 
along with the actual language for the job
 
though my own business is a bit of a ways away, still working on the prototype
 
4:41 AM
I am working as a python programmer right now and I am thinking about switching jobs but most jobs need another language in addition to python. Perhaps I should be learning C++ / C# after work hours.
 
I think C++ will shrink over time
C# on the other hand seems like good value to learn
 
4:56 AM
the error I've been seeing @shuttle87 btw
Failed to load resource: the server responded with a status of 404 (Not Found)
 
5:18 AM
Drizzle outside and petrichor in the air. I'm starting to suspect that spring is here...
I'm still bracing for snow for another month just to be sure
 
@Skyler Check your static directory settings
 
i disabled staticdirfiles, did a few bits of database shawfu and got it working
im not sure how because the output looks exactly the same as the hardcoded version, but o well
 
5:43 AM
pet peeve of the day: people who misspell python as "phyton" (or worse, "pyhton")
I have so many pet peeves, I could start a pet peeve shelter
 
you'd love MathLab
 
I could forgive that, Math is in MathWorks after all :D
I'm actually curious to know why the h was taken out of MathLab to create "Matlab".
 
@Ajit I suspect most jobs that want C# and Python are probably only using Python for tooling, while a job that wants, say, C or Rust is probably using Python for all the high-level stuff and the other languages for smaller bits they need to optimize, which is a lot more fun. (With C++, it could really be either.)
Pthyon is good, but only if you pronounce the y as a consonant.
 
@abarnert And if the P is silent?!
How would you pronounce it with y as a consonant? "thy-awn"?
"thy-un"? (or "thy-n")
 
Three consonants in a row, p, th, y. Not many people have clusters like that in their native language, and even if you do, I think it would be hard to say without spitting.
 
5:50 AM
cbg
 
phyton is a particle of light with a battle cry
 
Do any other languages get misspelled often besides Python and Matlab?
I'm guessing that's not a problem for C, D, and R.
 
^ I venture to guess that is true
 
A classmate of mine from way back in school went an entire month thinking C was spelled "sea" :|
 
5:53 AM
Matlab is Matrix laboratory
 
I can imagine the only people who'd have a hard time spelling R would be pirates... ;)
 
Do people type Elrang? Or Elixer?
 
(yes! met my bad joke quota for the day)
 
No you haven't... that previous attempt doesn't qualify
 
@piRSquared Haha if you don't find my jokes funny then I guess they aren't bad enough yet
 
5:56 AM
Hah!
yes, that is likely true
 
I had a friend who told me he'd been misspelling Java because "I thought it was like coffee". I couldn't figure out how he thought Java for coffee was spelled.
 
Also along the Star Wars theme: Jaba?
 
Yeah, maybe he spent 35 years talking about "mocha jabba" and never realized his mistake…
 
5:59 AM
You think the company was planet wide? What were the regional names on Tatooine?
 
They really should show him pouring blue milk into his jawa blend.
 
don't ask me, I ain't a Star Wars fanatic
I've seen all the movies though
 
I haven't seen any of the Disney ones yet. Waiting to watch previous six with my sons.
They need to get older
 
Are there regions on Tattooine? From the movies and the KOTOR games, it seems like there's one city, some moisture farmers spread out around it, and then even worse desert for the other 40000km.
 
And also, for the naysayers, it is very much possible to be emotionally vested into more than one franchise
 
6:01 AM
Nothing else is Doctor Who. Which is fine, because even Doctor Who usually isn't Doctor Who. So I can enjoy the other stuff also.
 
Is Dr Who that guy with weird powers? Or that time travelling show?
(hmm, oh, I seem to be confusing Dr Who and Dr Strange)
 
Yes. Doctor Who does occasionally have weird powers, but not consistently. Mostly he travels through time and uses his wits to get captured and escape enough times to figure out what to do.
 
@piRSquared The most recent one was good. And I mean, really good. They've stayed true to the original series (the ones from the 70s)
 
Also, most Doctor Who fans will get angry if you call him Doctor Who instead of The Doctor, which is pretty hilarious considering that the credits for the show have called him Doctor Who or Dr Who for more than half the seasons.
 
Is his (real) name not known?
 
6:04 AM
You mean The Last Jedi? I liked it because it was true to the first movie in the same way Empire Strikes Back was, rather than by copying its plot yet again.
 
I'm looking forward to it. I like Dr Who. I haven't watched for a couple of years tho
 
Yes, the most recent instalment... it released late last year I believe?
Yup, 12/15 last year
 
The Doctor's real name may or may not be a huge important mystery, a big joke, or a minor secret that a few of his companions and old friends from home know but it isn't worth mentioning on the show, depending on who's writing.
 
It premiered at the Shrine, yeah?
 
He may have forgotten his name...
 
6:08 AM
^ I certainly have
 
One of the novels from the era when the show was off the air implied that he'd accidentally erased his name from his memory.
 
@piRSquared It may have (not sure). I was in India for the winter, and I saw it at an imax near me
 
Or there's powerful name-based sorcery in the Whoverse :P
 
@AndrasDeak fanboy spotted!
 
Haven't seen a single episode...
 
6:09 AM
The name sorcery thing has definitely been hinted at strongly in a few episodes and books, but it's also been dismissed as nonsense in others. The best was the David Tennant Shakespeare one, which did both at the same time.
 
lmao. False alarm!
 
@AndrasDeak because you watch them in pairs (-:
 
The good thing about Who is that they can be as discontinuous as DC/Marvel and get away with it
 
6:14 AM
Doctor Who deliberately breaks continuity. To the point that the "time can be rewritten" was pretty much the catchphrase of the one before the last one.
 
I've noticed one of the ROs has pinned a starred comment about flask. I'm just curious as to whether that is O.K. to do since the comment doesn't really have anything to do with the room. Repeat: just curious, nothing more.
 
I wonder if the Marvel movies are going to start playing loose with continuity the way the comics do. Spiderman Homecoming seemed like they were testing the waters in that direction. Maybe because if they get to crossover with the X-Men movie universe, there's no way to keep anything straight.
 
Cabbage
Guys recommendation for a quick GUI library
Kivy or TKinter?
 
@cᴏʟᴅsᴘᴇᴇᴅ yes, that is OK
I also fail to see your point but that's another matter :P
 
I know tkinter very well, which is why I hate it. I've never used Kivy. What platform(s) do you need it to work on?
 
6:23 AM
My point is I'm not sure whether how alright it is to use RO privileges to further your non-room related goals
But since you, an RO, say it is OK, I don't see the need to question it further
 
@abarnert Windows 7 64Bit
 
Be back later, to be continued, sorry
 
I am going through Tkinter tutorial
coz it comes with python
 
(Meeting's starting)
 
Tkinter, you can get to solid beginner level pretty fast. The hard part is getting any further than that.
 
6:28 AM
I see..
Any idea of Kivy?
 
It looks nice, but I've never used it.
 
Okay..
Thank you , I will give both of them a shot ..
Kivy looks more modern
 
ugh... on kivy's getting started page is a link to lpthw
 
6:48 AM
Kivy is definitely more modern, but then everything is more modern than tkinter. But it seems like the main reason people use it is that it's the easiest way to build apps for all the major platforms including mobile without doing HTML/CSS/JS.
 
Right!
 
Last time I had to do a Windows-specific GUI, I used IronPython and… whatever the native .NET thing was before WPF. And before that, PyWin32 and its MFC wrappers.
 
Ahhhh Totally forgot about Iron Python
 
what gui do you use in python?
 
@Skyler Planning for Tkinter or Kivy
might look up Iron Python as well
 
6:54 AM
I don't do GUIs that often nowadays. I used to rotate between wx, PyQt, and PyGtk+ for cross-platform stuff as I got annoyed with each one and decided I liked a different one better, plus PyObjC for native Mac stuff.
 
7:05 AM
Ok. Kivy is a pain to get started with, Lot of dependencies. Going with TKinter. Mine is a small app so I dont think Kivy is suitable if you are going to distribute it to people who do not know to Pip install
python -m pip install --upgrade docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew kivy.deps.gstreamer --extra-index-url kivy.org/downloads/packages/simple
 
cbg
 
cbg
 
''.join(map(chr, (103, 98, 99)))[::-1]
 
^ quota met
 
7:20 AM
finally!
 
8:11 AM
Anyone Excited for God Of War?
 
cbg
 
9:00 AM
cbg
 
@cᴏʟᴅsᴘᴇᴇᴅ it's OK, other rooms do it, and we don't pin messages from ROs exclusively
 
Thanks, that clears it up
 
9:16 AM
when did I move to snek chat? ._.
anyway, cbg
 
@cᴏʟᴅsᴘᴇᴇᴅ so errr... why do you think flask isn't about Python?
 
@Anarach no
 
@Anarach I'd rather play God of Peace
 
I'd ratther play Cabbage of War
 
@JonClements I meant that the message does not really have anything to do with the room as a whole, or moderation related activity
 
9:22 AM
Interesting external projects/repo's/news get pinned now and then...
 
yup... still learning it seems
 
@AndyK Too Brutal for you?
 
Do we have a post that explains why a function's name doesn't change when that function is assigned to a different variable? Or maybe just explains the concept of the __name__ in general?
 
brief recbg
@cᴏʟᴅsᴘᴇᴇᴅ I was going to say what Jon has already said
Helping out with a new flask tutorial (probably to become at least semi-official?) is in the best interest of the python community in general. Would you object if someone pinned a "3.8 is out" message, for instance? That wouldn't be very specific to the room
 
10:12 AM
I get where you're coming from. But to nitpick your example, 3.8 would apply to the whole community, whereas flask would apply to those who use it, or those who want to. Not everyone here does web dev stuff.
Not to say that I don't want to help out, I certainly do. I was just wondering how justified the pinning was. That has been addressed quite well, thank you.
 
Yes, for instance I don't, yet I fail to see how my lack of personal use for flask diminishes its use for others :P
 
I never said it would
In fact, I'd quite like to learn flask, it's on my todo list
 
It's fair to question such a sticky I think, but I also feel that it is warranted in this case
 
@cᴏʟᴅsᴘᴇᴇᴅ you could write a flask app to keep those todos on :P
 
If he hadn't I would have asked for one
 
10:15 AM
anyway, gotta go yet again, busy day
 
DSM
Brief-heading-into-work-early cabbage.
Re: pinning, people can ask whatever they like whenever they like :-), but honestly, ROs pin things when we think it would on balance be a good thing that they're seen for longer than normal, whether related to Python or not. That's it. There's no formal policy and I'd be opposed to there being one.
 
stackoverflow.com/questions/49552335/… dupe. The OP posted a cheap knock-off self-answer that just repeats everything from the answer in that dupe, so I figure it must have answered his question.
 
DSM
Nope, nobody's starring anything when I realize I typed "their" when I meant "there"..
 
@DSM meh... could have just edited your message :)
 
ROs have no time limit to edits iirc?
 
10:27 AM
@cᴏʟᴅsᴘᴇᴇᴅ nope - same as everyone else
 
DSM
Realized too late :-( I'm hoping I was originally thinking of saying "their having one" and changed my mind at the last second.
 
that's going to stick around
 
@DSM seems to be fixed now :)
 
DSM
It's a little awkward because of the opening "there" and the fact the referent of "their" is unclear ("the pinning of things"). That's just not a great sentence..
Saved by the puppy!
 
10:30 AM
@JonClements Ah, it's just you guys then :D
(with that insane puppy power)
 
@Anarach too many idolized brutalities I would rather say. When I see these games, it is almost like kids saying "wow using force is great" until you see what real force is and what are these effects when put upon you
But I have a bit of understanding of brutality, first hand
 
@cᴏʟᴅsᴘᴇᴇᴅ Basic rules are a user may edit/delete their chat message within 2 minutes. Mods can edit/delete any message at any time. There use to be a bug which allowed ROs to delete messages from other users less than 2 mins ago, but it got misused in certain rooms and was revoked.
 
You mean to say that it was misused and consequently fixed :D
 
@HarshitSeksaria hmm?
 
@HarshitSeksaria whoops, without any context, you may as well be asking "downvote and close my poorly asked question". Do you have a specific query? That doesn't even have anything to do with python.
 
10:42 AM
SO doesn't really do remote debugging. There is no screenshot of the problem or anything at all that could help anyone figure out what the problem or solution would be
 
And um, it's not even python
Ah, I see the reason for the downvote hell... that user's been broadcasting their question in every single active chatroom
 
 
2 hours later…
1:07 PM
cabbage all - or any
 
morning cbg
 
I'm implementing a __repr__ on a subclass. Per the convention I've seen, the __repr__ should be able to be essentially paste-able into the console to recreate the object exactly. So I'm wondering if my top class' __repr__ returns Classname(parameters), can by sub class' __repr__ return {super().__repr__()[:-1], subclass_parameters)
This would be so that the closing bracket on the topclass' __repr__ is removed, so that subclass additional parameters can be placed within the brackets.
Feels kinda dirty hacky to do that.
 
cbg
 
Agreed, relying on the parent class's __repr__ to return a specific string doesn't feel like a great idea.
In this case you can get away with defining a very generic __repr__ function that works for both the parent and the child though
class Parent:
    def __init__(self, foo):
        self.foo = foo

    def __repr__(self):
        return '{}({})'.format(type(self).__name__, ', '.join('{}={}'.format(attr, value) for attr, value in vars(self).items()))

class Child(Parent):
    def __init__(self, foo, bar):
        super().__init__(foo)
        self.bar = bar

print(Child(1, 2))  # Child(foo=1, bar=2)
 
\o cbg
 
1:21 PM
(I know it's unreadable, but I didn't want to make it too long)
 
@MooingRawr btw.....the NHL playoff structure is dumb and is the worst structure in sports ever.
 
@Aran-Fey Oh, okay. I thought I was fine relying on the parent's repr, I just wanted to get the subclass' parameters within the brackets around the parent's.
 
Personally, I wouldn't consider a class's __repr__ to be part of its public interface, so I wouldn't want to rely on its return value being formatted exactly the way I need it. It doesn't feel right even if both classes are your own and you can be 100% sure that the parent class will do exactly what you want, though I can't explain why it feels wrong
 
@Aran-Fey that's what __str__ is for
 
1:37 PM
@idjaw I would agree. :( At least it's looking good for my team, however I don't want to play the Lightning first round, and the B's would make my blood pressure skyrocket :(
 
1:48 PM
cabbage folks
 
well that is part of it @MooingRawr it isn't looking good for the Leafs and in an unfair way
 
what was the reasoning behind this implementation?
>>> class C:
...     from itertools import count
...     c = count()
...
...
>>> C.c
count(0)
>>> class C:
...     from itertools import count
...     c = [count() for _ in range(10)]
...
...
Traceback (most recent call last):
  File "<input>", line 1, in <module>
    class C:
  File "<input>", line 3, in C
    c = [count() for _ in range(10)]
  File "<input>", line 3, in <listcomp>
    c = [count() for _ in range(10)]
NameError: name 'count' is not defined
 
@Aran-Fey So I should really be hard coding the subclass' repr by hand, rather than extending the parents'. That's not very DRY...
 
@MooingRawr think about a normal any other league in any sport that has a normal playoff structure, the leafs would be "rewarded" playing a lower seeded team instead of bubbling up the "best" teams to play each other right away
 
(Note: I know I can get access to count as C.count, I'm interesting in the reasoning why the generator expressions are not binding the names when they are created)
 
1:51 PM
@idjaw Well there's only like 1 wild team we could play... I don't like it personally but I can understand it... I still think 1-2 and 3-4 should face instead of 1-4, 2-3... The NBA uses 1-8, 2-7,3-6,4-5 kind of matching so I guess we are doing the same :\
 
132
A: Accessing class variables from a list comprehension in the class definition

Martijn PietersClass scope and list, set or dictionary comprehensions, as well as generator expressions do not mix. The why; or, the official word on this In Python 3, list comprehensions were given a proper scope (local namespace) of their own, to prevent their local variables bleeding over into the surround...

 
@vaultah cheers mate, looking at it now
 
@toonarmycaptain Well, that depends on how you implement it. You don't have to repeat yourself if you can use a generic implementation that works for both classes. (Or find another way to extract the duplicated code into a function)
 
@MooingRawr what happend to just....top 8 of each conference
why complicate things
 
cbg
 
1:54 PM
Is the ping sound same here? can someone please ping me?
 
Ping @Abcd
 
@idjaw No clue, I'm just happy that my team is finally within reach of contending. I do miss the top 8 style plays though. I'm afraid of complaining just in case the league is watching which might cause them to send bad refs to make terrible calls against us.
 
lol
 
@vaultah sweet! that was exactly what I was looking for :) (+1 for MP again :P )
 
Dude not even kidding, after That Game 7 game against the B's and before that, the series against the hurricanes... I've learnt to just keep my mouth shut until the game is over :D
It seems like the great white north always get shafted by terrible ref calls. From the MLB game 5 3 seasons ago, to the NBA allowing other teams to push us around, idk, seems like they like testing our kindness stereotype. I'm willing to bet that if we joined the NFL, it would be the same...
 
2:35 PM
morning cabbage
 
I have a question
are there one-liner to change the content of a column in Python like what awk can do? like this one -> unix.stackexchange.com/questions/136322/…
I don't think so
but who knows. @Arne this question is especially for you
 
@Aran-Fey I don't understand how you don't repeat yourself without using the top class repr, unless you use a completely separately defined function that you pull into both classes, which doesn't seem...sensible.
 
Well, you have a point. But the more code you extract into a separate function, the less you repeat yourself. The only way not to repeat yourself at all is to use the same method for both classes :P
 
3:06 PM
@AndyK yes, but one should not use it
It would start as [' '.join(cols[:i] + [fun(cols[i])] + cols[i+1:]) (])
The last bit is only there to prevent bracket whiplash in readers
 
wim
@AndrasDeak I think @cᴏʟᴅsᴘᴇᴇᴅ point is that it was pinned by a project maintainer, in order to benefit himself. Just because that's a Python project it doesn't mean it's immediately important or relevant to all Python users.
 
I see
 
wim
I would tend to agree that shouldn't be pinned. But it's not like I'm going to sue or anything, care factor is approximately zero.
 
@wim then again, we've pinned messages by non-ROs linking to non-RO projects before.
 
My column replacer is probably missing an outer f.write('\n'.join()) or something but you can catch my drift
 
wim
3:18 PM
@vaultah Actually I just realised we don't know who pinned that. If it was pinned by someone other than the guy seeking help, then my point is moot.
 
In room meetings, users have fairly consistently expressed interest in contributing to a joint project as part of a fun community-building effort. Perhaps one might think of the pinned message as a pilot attempt of that.
 
+1 for that
 
wim
could be fun :) I would prefer a greenfield project though
 
@wim Argument for: davidism is a strong part of the community and it's something he's working on that will benefit the community. Argument against: it's pretty specific to flask
 
DSM
Worrying about who's pinning what to determine whether some previously unheard-of rule was broken is hopefully a new low in room pettiness.
 
3:24 PM
unless you have a vendetta against flask, it's pretty hard to say that there's any serious problems with pinning it :)
 
No, not against Flask
 
@DSM Aw c'mon, this is room 6. Surely we can sink lower than that ;) ;D
 
wim
When a user expresses concern about RO action and the RO just respond by calling them petty, that's neither nice nor professional.
 
I expect v2.0 would be a bit more of a "from scratch" situation, but having v1.0 be an existing project has the benefit of built-in direction. Here is a thing, here is the stuff the thing needs. All of our cats are pre-herded and facing the same way.
 
DSM
@wim: I'm happy to die on this hill -- worrying about the conditions under which someone pins a starred comment in a chat room does indeed strike me as an almost perfect example of an "undue concern with trivial matters".
 
wim
3:30 PM
You can have that opinion but calling them petty and saying it's bringing a new low to the room is still not nice, IMO. Three users thought it was questionable.
 
Two of which constantly pick on ROs and that user in particular
 
DSM
Then three users can be, and are, wrong, and I'm not going to pretend I find this topic other than embarrassing.
 
Would there be any objections to re-titling this question as "What tkinter modules were renamed in Python 3?"
23
Q: How do I use tkinter modules with Python 3?

Pratik DeoghareI want to select a file from a dialog box. Here is code that does all I need, but when I run it: ImportError: No module named 'tkMessageBox' How can I make this example work with Python 3?

 
Nay. Sounds like a good change to me.
 
3:38 PM
There are quite a few duplicate questions about tkinter's renamed modules. I figured this could be a good cannonical duplicate target
 
wim
yep, looks good
I wish logging and unittest also had taken the 3k opportunity to make such name changes
 
Top answer looks like a change for the better indeed
 
23
Q: Which tkinter modules were renamed in Python 3?

Pratik DeoghareI am trying to create a file chooser dialog box. However, when I try to import tkMessageBox in Python 3, I get an error claiming that the module does not exist. import tkMessageBox # ImportError: No module named 'tkMessageBox' I get similar errors when trying to import other tkinter modules i...

How does this look?
I was actually looking for this specific post, but had some trouble finding it. Hopefully the rename helps
 
Looks good to me
 
I don't think it should be tagged though
The question isn't about Python's import system per se
 
3:49 PM
@vaultah Done. Tag removed
 
wim
Hmm. Think I just found a Python bug.
 
Yeah? I'd be impressed (unless it's Python 3.7 ;)
 
wim
percent eats whitespace before the format char
>>> '100% weird' % ()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: not enough arguments for format string
>>> '100% weird' % (1,)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: unsupported format character 'w' (0x77) at index 5
not sure if it's documented, saw it in a logging crash when it tried to format the message (% signs need to be doubled)
 
Isn't that legal for % 5d for signed ints etc?
I.e. "leave a space for positive numbers"
 
wim
I guess so, but "% w" isn't a valid format spec
 
3:58 PM
Percent tokens can have whitespace inside them? Weird.
>>> "% s" % "blah"
'blah'
 
Strange that the turtle module wasn't renamed in Python 3
 
This is a bit akin to '\D` where it's not a control character
 
It's listed with all the other tkinter modules
 
wim
yeah apparently as many as you want
>>> '%       a' % (1)
'1'
 
Isn't that the padding character?
 

« first day (2721 days earlier)      last day (2226 days later) »