« first day (2140 days earlier)      last day (2802 days later) » 

6:00 PM
Isn´t there another convenient way of doing so, without making it into a OS-dependant release like .exe?
 
No one said that.
 
Because I tried using pyinstaller, and it worked fine, but I want the file to remain a .py file, but with all the dependencies
 
No one mentioned OS-dependent releases at all.
 
bundled in one folder
 
another thing that worries me is that Joel is supposedly the CEO of SE.
 
6:01 PM
1 min ago, by tristan
it will try! look into virtualenv if you can type commands on that machine or search for "python packaging" if not
 
and they've even got extra funding, but I've got a feeling that Joel isn't steering the ship :D
 
Maybe he thought "I should buy a boat"
 
I got that same impression as it seems like a lot of dodging and "I wanted to give SE employees a chance to run with this idea" kinda statements
 
I know we've discussed this already
 
@AndrasDeak was the "yup ---v" comment directed towards me?
 
6:02 PM
Yup ---^
 
He was pointing at Tristan's message with the v.
 
Ah lol
I get it now :P
 
yup ----------------------^
 
Thanks for the suggestions
 
Look into Python packaging.
 
6:03 PM
hang on, isn't venv os specific?
 
But you'll always have to install it on the other computer (either manually or automatically)
 
the steering the ship is a good analogue with the last un-shipping
 
So just copying it over wont work I guess
 
sure, it allows for packaging, but I can't create a venv on my macbook and expect it to work on a windows box later, can I?
 
That "install" might be copying your libraries across, or downloading them from the internet, or whatever.
It will yes, but it's not a very good solution.
It's not as reproducible.
 
6:04 PM
I see
I will take a look at it
 
@JGreenwell pulling the plug? The SE mascot is called Bubbles after all, ain't she? (cue @tristan trigger)
 
@tomSurge you can use a zip.
it wouldn't work for binary modules though
 
user559633
leaving that setup on the table
 
@AnttiHaapala doesn't return a list in python 3.... oh wait
 
6:06 PM
@AnttiHaapala Thanks, will take a look at it :D
 
Unwrapping my fresh chat privileges
sorry if it's off topic
 
Also, would you say Python is a scripting, or a programming language?
 
Yes
 
@tomSurge Yes.
 
user559633
Definitely one or both of those
 
6:08 PM
In my opinion it can be both
 
user559633
It's also a type of snake. Little known fact.
 
Not only that - but also the (partial) name of a comedy troupe!
 
user559633
What? No. Crazy
 
I know it as a rollercoaster, really.
 
6:09 PM
it's something completely different
 
% find
./foo
./foo/__main__.py
% python3 -m zipapp -o foo.py foo
% python3 foo.py
Hello world
% file foo.py
foo.py: Zip archive data, at least v2.0 to extract
 
user559633
@WayneWerner well, it's definitely time for that
 
Antti, the last stronghold of ontopicness
 
@AnttiHaapala Ah, I was trying to figure out what you were doing there, but yes, indeed
 
@AndrasDeak I must be Asperger I guess :D
 
6:11 PM
mainly because I'm not familiar with the zipapp order of arguments
 
@AnttiHaapala Asperger than most of us
 
but i see it's basically like zip :P
 
@AndrasDeak Aspergerer
 
user559633
Cough offensive cough
 
I've used the zip-based app thing... to test it out
 
6:12 PM
@WayneWerner well, a zip is basically a zip
@tristan ?
 
offensiveer
 
Tristan go to your the django room
@WayneWerner seems to be the same as compilers: gcc -o foo foo.c
 
@AnttiHaapala or just ./foo.py
 
@AndrasDeak that I could call offensive
 
alright folks, my breaktime is over. Catch you all later!
 
6:14 PM
rhubarb @inspectorG4dget
 
rhubarb
 
night
 
user559633
eh, say what you want, but using asperger/autism to say "i'm nerdy and focused" is pretty rough
 
Unless you've actually been diagnosed, in which case, go right ahead
 
user559633
100% yeah.
 
6:16 PM
There's been a few times recently where the room has crossed the boundary from joking around to not on.
 
Sure. I guess what I mean is that it's Antti's fault.
 
user559633
it's stream of consciousness chat in here, so it happens
 
There's so many better ways to have a conversation than to bring up mental illness or some other provocative wording. "Someone else did it first" is also not a valid reason to continue.
And at least in the past the room was a lot less "stream of consciousness". It's ok, take a minute to think about how you're going to say something clever.
 
Oh it was no reason to continue, just placing the blame a posteriori.
 
This isn't about that message specifically, just a general trend.
 
6:19 PM
Sure:)
 
> We believe that the Python chatroom should be a friendly and welcoming place. If any behaviour in the room makes you feel uncomfortable, you can @notify one of the room owners and we'll do our best to sort it out. - the rules
 
user559633
My point is that it's fine if it's stream of consciousness in here, but moving away from some topics happens not by sharp response, but mindful drifting
 
So I'm still purple
But I can't fix my avatar now that I'm involved in the investigation
 
You're lime green here.
 
@davidism I saw you created flask-asgi on pypi. Have you done work on this?
 
6:22 PM
@davidism even in the avatar context menu?
Could be still server-specific
 
@AndrasDeak everywhere
 
vaultah mentioned the other day that I looked purple to him. It's an epidemic among the green gravatars!
 
but I have observed changing avatars today too, so it's not fixed
 
Gravatar has caching issues.
 
Maybe I should upload a static copy of Kevintar Classic (tm)
 
6:23 PM
@Kevin umm... it all started with you and me and JRS here... you just missed it :P
 
@sontek I have not had time to investigate ASGI yet.
 
And their cache is at the CDN level, so it varies by IP address what cached image you see.
 
I'm not even sure if it belongs more with Flask or Werkzeug, which is why both names are reserved.
 
@Martijn but why are the new (uncached) different?
 
@AndrasDeak more caching to catch up with the new situation?
 
6:24 PM
Cachception
They need to cache up
 
@sontek were you interested in doing work on it?
 
I've been blaming caching since day 1.....
 
@AndrasDeak and what day does it say it is now? I still see 1, which doesn't seem right. What's going on?
 
> On Monday a monk was sent to master Kaimu to inquire, “What is the greatest peril of caching?”
>
> Kaimu answered, “Monday is my busiest day. Ask again tomorrow and I will teach you all I know.”
>
> On Tuesday the monk returned and asked the same question.
>
> Kaimu answered, “Monday is my busiest day. Ask again tomorrow and I will teach you all I know.”
 
user559633
6:30 PM
That's great.
 
@davidism try restarting
 
If you wanted to know the number of lines would you do enumerate or sum? Like so...
 
I'd look at how raw tristan's nostrils were
 
for i, val in enumerate(lines):
    do_something(val)

print(i)

# or

count  = 0
for val lin lines:
    count += 1
    do_something(val)

print(count)
or, some other way?
 
6:38 PM
I would not do 1
 
Yeah, that felt pretty icky to me
 
Be explicit
For example in JS with let that'd fail
 
=/ well my talks didn't get accepted for the summit.
 
Just a bit hacky
 
@idjaw boo :(
 
6:39 PM
I didn't think I would be this bummed about it.
 
I'd probably just use len(lines).
 
stackoverflow.com/q/39152235 Server Fault or too broad
 
On the bright side we will have two guys here representing other awesome projects we did.
 
@Kevin it's an iterator, not a collection
 
Is len O(n)?
 
6:41 PM
I'd probably just not use an iterator.
Cut the Gordian knot with Occam's razor.
3
 
lol. I suppose that's a reasonable solution, even if I am reading from a file I don't think it's supposed to be terribly large (as in I would be shocked if it was a few MB)
the purist in me balks at that idea, though :P
 
Realtalk, I'll do with open("file.txt") as file: lines = file.read().split("\n") if I need to do anything fancier than iterating through the file once
But then, I live in the idyllic realm of small data, where I never need to worry about loading a five gig log file into memory.
 
Truly you are blessed
 
Psh. I'd read 5gb.
15GB would be a problem
(well, not 5GB on my personal machine...)
or wait... how much memory do I even have?
7.4GB reported... yeah, I'd open 5GB, if I wasn't doing anything else
 
6:45 PM
@WayneWerner I'd go with version #2. Doing for i, val in enumerate(lines): when you don't use i in the loop seems smelly to me.
 
@Ffisegydd O(1) for lists.
 
user559633
@idjaw meh. there will be another conference.
 
Pycon UK!
 
@idjaw Never surrender! Never give up!
 
Yeah, len is O(1) for any (sane) container type. All the built-in container types store their length as an attribute.
 
user559633
6:48 PM
would have you preferred to present a more catchy talk that you're not interested in giving? i assume not, so don't feel down on yourself
 
user6568562
@idjaw We'll do our own PyCon, with blackjack and hookers
 
user559633
You could go right down the middle and do
_i = 0
for i, val in enumerate(lines):
..do_something(val)
.._i = i
 
user559633
dose chat features doe
 
Jul 24 at 12:11, by Andras Deak
I'll make my own documentation! With blackjack! And hookers!
 
Thanks guys. Moving forward! cheers
 
user559633
6:51 PM
@idjaw There's always NoNoCoSoPyCon.
 
@JGreenwell Apparently there's a market of at least two
 
@tristan I have great talk ideas for that one .
But I'm going to need a small sandbox
and a ventriloquist
(I'm making this up as I go along, go with it)
 
Jun 30 '13 at 13:50, by Lattyware
Make your own stdlib, with blackjack and hookers.
 
user559633
@idjaw What's the ventriloquist for?
 
there are a few others, its apparently something of a theme here :)
 
user559633
6:55 PM
Also, get your employer to sponsor it. Preferably as a gold sponsor so that we all get gold chains
 
user559633
afk taco time
 
user6568562
@JGreenwell We're the same person, but shhh, don't let them know
 
user559633
actually, chipotle or vegan tacos? someone make this incredibly important decision for me
 
@tristan I haven't figured that one out yet.....I think I got over creative with that one
 
user559633
"well, how else would you give a talk on Puppet?"
 
6:57 PM
chipotle
 
user559633
that's the justification i needed, thanks :)
 
I still love that my wife actually gets the joke "Aww...photons - I don't know if your particle of waves but you go down smooth" without me having to explain it :)
 
@tristan
 
Enjoy;)
 
the day I realized she like Warehouse 13 and Dr. Who (i.e. the day I realized I was dating a geeky girl) was a magical one
 
7:02 PM
@idjaw Just watched that 2 nights ago.
 
user6568562
I didn't know Python existed until a month or so ago and I already feel uppity about semi-colons in JS. Do you need them for the coal combustion, engine ?
 
only about the semi-colons?
 
user6568562
What else should I feel uppity about ? I'm open to suggestions.
 
Never having to write a line consisting of only a right curly bracket.
//old and busted
function frob(x,y){
    return x+y;
}

#new hotness
def frob(x,y):
    return x+y
That's a savings of 25% LOC
 
Also, comprehensions. Why doesn't every language have them?
 
user6568562
7:07 PM
@Kevin That actually makes me purr, you know : D
 
sorry :D had power outage
 
var frob = (x, y) => { return x + y; }; is as close to "no single right curly as one can get
 
@randomhopeful not needing a 5-page cheat sheet to know what counts as "true" and "false"?
 
My current js pet peeve is having to alter the prototype of HTMLCollection if I want to be able to do document.getElementsByClassName(...).forEach(...)
 
@Kevin but what about maximizing the git graph?!
 
7:13 PM
Well, if you really want to have lone curly bracket lines, you still have the opportunity:
>>> foo = {
...     "bar": "baz",
...     "qux": "zort"
... }
 
oh, you mean people trying to write JS like Ruby - yeah, that gets ugly
 
@Kevin says the starlord who's language uses braces.
 
I'm pretty sure I also can't do for(node in document.getElementsByClassName(...)). I just want to not ever write for(i = 0; i < thing.length; i+=1){ ever again.
 
Not everyone started out perfect: gist.github.com/kennethreitz/241997
 
@Karin maximizing the git graph?
Glad you asked
Oct 2 '15 at 20:14, by idjaw
"What makes you a rockstar?". "Well I'm glad you asked:" Quickly point them to your git repo after you have conveniently performed this magic: https://github.com/avinassh/rockstar
 
user6568562
7:15 PM
@MichaelEdenfield That sounds like there's fun times ahead
 
> Do I contradict myself? Very well, then I contradict myself, I am large, I contain multitudes.
 
@Kevin you are correct, getElementsByClassName returns an HTMLCollection (or NodeList if IE...I hate IE) so no foreach
 
Dear whoever is in charge of this sort of thing, please do the needful and implement .foreach. Regards, Kevin.
 
7:19 PM
I'm going to go ahead and assume there's a really good reason the devs didn't implement simple common iteration interfaces for their class with "Collection" in the name
Maybe it's "the interface for HTMLCollection was finalized long before .foreach was a twinkle in its inventor's eye" or "HTMLCollection's implementation is blazing fast C and adding for..in functionality would drop its amortized runtime from O(log(N)) to O(3^^^^N)"
Anything but "It just didn't occur to me to implement it idk lol"
 
@Kevin That's pretty much what I always assume
 
user6568562
7:43 PM
@MichaelEdenfield The accepted answer is very interesting and humbling, actually. I was just making a joke and being a smart ass
 
user6568562
I guess every language is the best, except when it's not
 
user559633
@idjaw I try. Not hard, but I try.
 
> I can't promise I'll try. But I'll try to try.
 
user559633
oh chipotle. you so delicious. please don't poison me.
 
user559633
 
user559633
7:52 PM
internet 2016
feb: "ugh can you guys please shut up about people getting poisoned by poor corporate policy at $company? stop talking about it, it's getting old"
mar: bunch of people get poisoned
jul: bunch of people get poisoned
 
I'm so confused as to how the food poisoning even happens at Chipotle?
 
hmm "chipotle's profits down 82 %"
that's so wrong, they're still doing profit :D
 
it seems like the exact opposite of what should be happening... or maybe it's just that the people who eat at Chipotle have far weaker systems than those who eat at the sludge bar McD's and Taco Bells
 
user559633
supply chain issues, hiring people that don't take care of their health or food safety seriously
 
user559633
@WayneWerner bro, you trying to say i have a weak system? bro who told you that? bro don't look at my calves, seriously, i'm sensitive about that
 
7:57 PM
Well, good night for today. Trying to improve yesternight's sleep record of 3 hours
 
@AndrasDeak ..
so that explains a lot
I've been sleeping record hours myself too
 
That and mobile:D
But written history doesn't speak of another time when I went to bed at 10 PM
I'm not sure how this works
rhubarb
 
user6568562
@AndrasDeak Laters [ :
 
8:26 PM
Fun bug: data, row = {'a': 'hello', 'b': 'world'} unpacks without error, so it masks if you forget to return a tuple of (dict, number) and instead just returned the dict.
 
@davidism did you use it somewhere?
 
Thus illustrating reason #3 that HTMLCollection might be the way it is: "Just because a thing could theoretically be iterable, doesn't mean it's a good idea to make it so"
 
Yeah, it was for a function that was scanning rows of text to extract objects, where each time it parsed successfully it would return the data and the next row to read.
 
@Kevin also, the iteration per-se is perhaps not as important as is that you can navigate it forward and backward.
 
And when I say "text" I mean "Excel file" so it's even worse.
 
DSM
8:29 PM
@Kevin: just saying hello
 
yeah, Excel files are worse text...
 
The usefulness of this function compared to how much the client wants it does not balance out.
 
Good timing for a hello, I have twenty seconds before I leave work
 
They would be better off just hand entering the data than hoping it was in a format I could guess.
 
DSM
Given how bad my other luck has been this week, I was due for some.
 
8:31 PM
Small talk barrage go! Lovely weather, how's the kids, is that a new watch?
 
DSM
Weather's too hot, no kids to my knowledge, and I don't wear a watch, but thanks for asking! Have a great weekend!
 
Yes, nonexistent, no, thanks for asking.
 
user559633
Oh ho ho be careful out there Kevin, it's a scorcher!
 
@davidism wat, how? Dicts are unordered. How does it know which to unpack to?
 
8:45 PM
@Ffisegydd it doesn't, but it is iterable in some order, so it just unpacks them one at a time. If there's two targets and two keys to unpack, no error.
 
@Ffisegydd iteration order
 
Right yeah.
That's awful
 
it is iterable unpacking...
dicts are iterable...
that's the "obvious way" :D
 
Is dict ordering not an implementation detail though?
 
of course it is.
but anw. the problem is simple:
dictionaries shouldn't be iterable.
in python 3 there is keys() already; that is an iterable key view.
java Map is not iterable :D
it is again yet another case of a feature added to Python in 2.smallnumber without thoroughly thinking and checking what did the other projects do
 
8:49 PM
Pfft, this does not get the Fizzy Seal of Approval.
 
yeah.
2.2 added iterators
until that there was no problem I guess...
 
user559633
iteration probably didn't exist until then
 
@tristan not for dictionaries
but everything with __getitem__ and __len__ could be automatically iterated
the old-style sequence protocol
"In 2.2, Python’s for statement no longer expects a sequence; it expects something for which iter() will return an iterator. For backward compatibility and convenience, an iterator is automatically constructed for sequences that don’t implement __iter__() or a tp_iter slot, so for i in [1,2,3] will still work. Wherever the Python interpreter loops over a sequence, it’s been changed to use the iterator protocol. This means you can do things like this:"
in 2.1 a sequence was required for for loop
only then someone then decided that dictionaries should be iterable as such - fail.
then we have:
for i in iter(d), for i in d, for i in d.iterkeys(), for i in d.keys(), for i in d.viewkeys()...
"Iterator support has been added to some of Python’s basic types. Calling iter() on a dictionary will return an iterator which loops over its keys:"
"In a minor related change, the in operator now works on dictionaries, so key in dict is now equivalent to dict.has_key(key)."
<- but again that was a big change.
because in would step through a sequence checking if there is any matching element, but these weren't the keys.
 
9:07 PM
I want to do something that's feels vaguely bad: get the module that an exception was raised from, and only handle the exception if it came from a specific package.
This is why packages need their own exceptions.
 
explicitly raised exception?
raise Exception(os.urandom(16).encode('hex')) :D
@davidism this isn't requests by happenstance?
"All exceptions that Requests explicitly raises inherit from requests.exceptions.RequestException."
 
No, openpyxl. When you're in read only (stream) mode and you try to read beyond the last real cell, it raise an IndexError because of some internal manipulation of tuples.
 
and in addition there are countless other exceptions let pass through
Ilja and I needed to do some Excel exporting.
we ended up writing a Java program for it.
 
Which I guess kinda makes sense, but I'm not sure if the other thing I'm doing might raise an IndexError that I do want to handle. Not the worst problem, I can work around it.
 
user559633
That doesn't seem vaguely bad, that sounds perfectly logical.
 
9:16 PM
from codetransformer import pattern_matched_exceptions
import re

def match_regex(match_expr, exc_type, exc_value, exc_traceback):
    return re.search(match_expr, exc_value.args[0]) is not None

@pattern_matched_exceptions(match_regex)
def anti_antti():
    try:
        anttis_function()
    except r'(?i)^[a-z0-9]+$':
        print('hexadecimal exception message')
@AnttiHaapala ^
 
Oh my cabbage.
 
nice :D
awful :D
 
absolutely awful :D
 
9:17 PM
Oh right, that talk is still on my to watch list.
 
@MartijnPieters waynewerner asked if it is possible to execute some code in try:finally: to avoid executing the finally-block
 
That talk was great fun too.
 
I was thinking about modifying the bytecode so that it does "RETURN_VALUE"
in the beginning of finally-block...
 
@AnttiHaapala os._exit()
 
but it would need ctypes...
yeah that would work too
but maybe the point was "and continue running the code"
 
user559633
9:20 PM
he did not specify, which means silly answer time
 
I'd want to write a python bytecode optimizer
 
@AnttiHaapala Oh, but that's cheating, that's changing the rules of the game! :-P
 
user559633
os.system that calls to sed and removes the upcoming finally block and restarts the process :)
 
But that same project could easily rewrite bytecode to skip the finally block based on a condition..
 
@MartijnPieters but it is a running function :P
 
@AnttiHaapala yeah, just inject some bytecode to ignore the finally block if some condition or other is met.
 
The analog version of "sed to remove code and restart"
 
  >>> foo.func_code.co_code = 't\x00\x00\x01d\x00\x00S'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: readonly attribute
:/
need ctype :d
 
How is it useless? It turns itself off. Think of the power savings!
 
user559633
That mechanical lego one is cool
 
9:31 PM
@AnttiHaapala just build a new code object and function object.
 
user559633
I love this by the way.
 
or watch the talk.
My post there only replaces code co_consts, but you can replace the co_code bytestring too.
 
Yep, couldn't find it, but that's one of the ones I was thinking of. I feel like there was one with a lever rather than a switch too.
 
user559633
I build a pointless machine in highschool. Dual proc home server that I'd turn on, it would thermal warning, and turn right back off
 
user559633
 

« first day (2140 days earlier)      last day (2802 days later) »