« first day (2823 days earlier)      last day (2128 days later) » 
01:00 - 20:0020:00 - 00:00

1:25 AM
how could sys.path show up differently in windows powershell and in IDLE?
(shows up the same in command line and windows powershell)
i have reason to believe the cmd line version is the correct one, as well
 
2:04 AM
Reactions to an old 2016 question on Creating multiple aliases for the same import? It sounds like a bad idea in general; are there legitimate use-cases?
 
 
3 hours later…
4:52 AM
@smci no.
alll in all, simple assignment would be better.
and explicit
 
5:14 AM
@AnttiHaapala Sure, I mean post your reactions there too. Should we leave the question open?
 
@smci why should it be closed?!
 
@heather it isn't difficult for a program to set PATH to whatever they want.
 
5:45 AM
@AnttiHaapala I didn't say it should be closed, but I strongly suggest it should be improved, and surely that has to start with the OP (or fail that, anyone else) actually offering a justification for creating multiple import aliases. Because noone has yet suggested one. Please post comments to the OP
 
@smci I upvoted an answer and commented it. That's enough
 
6:06 AM
@AnttiHaapala Not for a question with a faulty premise which teaches people how to abuse the language. The onus is on the OP to show why this is useful and necessary. Instead of simply learning how to microtime things in Python.
 
@smci there are valid reasons for having aliases for some things in some module. Even python standard library has them. There are no valid reasons for not using the assignment as in the other answer.
 
6:34 AM
@AnttiHaapala If you could post an answer identifying valid cases for multiple aliases to import (especially for user code, not Python internals), I'd love to see them. Yes I also think assignment is preferable, that was my thinking. I imagine OP just wanted to make it really really explicit in the code.
 
@smci I've told already I've done enough there :D
 
WTY
 
cbg for the Monday folks
 
cbg
 
cbg
 
7:22 AM
cbg
 
cbg
 
cbg
Sigh, ... most of the usage of that tag is about integer accumulators, not as the tag wiki says "Counter is a container that keeps track of how many times equivalent values are added. It can be used to implement the same algorithms for which bag or multiset data structures are commonly used in other languages."
@MartijnPieters you're number 2 in ^:D
 
7:55 AM
My vote for this day's contestant for stellar question titles goes to: extract some data out of some elements.
 
8:14 AM
hahaha, nice one
 
 
2 hours later…
10:40 AM
@Arne well it's not wrong
 
the new catch-all title: "things don't work the way I wish they would"
once I understood the question I saw that it wasn't quite as vague as it seemed, with "elements" meaning xml-elements.
But that kind of context just dilutes the joke
 
11:14 AM
cbg
 
cbg
 
In python > 3.6 dictionary keys maintain order. stackoverflow.com/a/39537308/974407... Which I can see works. However getting the keys out of the dict in order doesn't seem to work. list(dict.keys()) doesn't print in order, and for k in dict: doesn't print them in order but if I inspect the dict it does come in order.
Anyone know how I can get the keys of a dict out in order?
 
what do you think "order" means?
Python 3.7.0 (default, Jun 29 2018, 00:16:57)
>>> d = {'ac':33, 'gw':20, 'ap':102, 'za':321, 'bs':10}
>>> list(d.keys())
['ac', 'gw', 'ap', 'za', 'bs']
works for me
 
It's psycopg
 
do you have a specific example where it doesn't seem to work for you?
 
11:22 AM
So for psycopg I send in the following:
SELECT
  dim_account.industry AS "dim_account.industry",
   dim_opportunitystage.default_probability AS "dim_opportunitystage.default_probability",
   dim_opportunitystage.is_active AS "dim_opportunitystage.is_active",
   dim_opportunitystage.is_closed AS "dim_opportunitystage.is_closed"
FROM analytics.f_opportunity AS f_opportunity
 INNER JOIN analytics.dim_account AS dim_account ON f_opportunity.account_id = dim_account.id
INNER JOIN analytics.dim_opportunitystage AS dim_opportunitystage ON f_opportunity.opportunity_stage_id = dim_opportunitystage.stage_id
 
hold on, start with vanilla python
 
Just want to tell you the whole thing
 
no, start with vanilla python
convince yourself that it works/doesn't work there
this will tell you whether your bug is in psycopg or how you're using it (it probably is)
 
I just realized that Chrome sorts the dictionary when turned into JSON
It's not python
 
11:23 AM
It's psycopg2
Chrome sorts the json dict alphabetically which happens to the right order
 
okay?
 
So when I run
`results = engine.execute(base_sql)`
The data comes back like:
{'dim_opportunitystage.is_active': True, 'dim_opportunitystage.is_closed': False, 'dim_account.industry': 'Some Private Data', 'dim_opportunitystage.default_probability': Decimal('30.00')}
Which the keys are not in the order that I queried in.
 
if there's a non-python step where you know the dict order is being messed with, what are you exactly expecting here?
 
"Here" meaning this chat room or "here" meaning my questions answer?
 
Probably both. I'm not trying to discourage you from asking, I'm merely confused why you're asking about dict order in python 3.7
 
11:27 AM
Because dict order is supposed to be consistent in python 3.7 AFAICT from that post. Is that correct?
 
4 mins ago, by Andras Deak
no, start with vanilla python
4 mins ago, by Andras Deak
convince yourself that it works/doesn't work there
and yes, it is correct
 
Ok one sec
>>> a = {'a':2, 'b':3, 'c':4}
>>> list(a.keys())
['a', 'c', 'b']
Wait derp.... My fault
 
python version?
 
Yep
 
okay
 
11:29 AM
I'm an dumbo
 
Also my flask app is running 3.5.5 so that's a problem too
I just figured out
 
yup
 
Well the rubber ducking helped
So thanks.
 
no problem
 
11:43 AM
Hi everyone! I really like to try to help others by answering questions, but sometimes it seems like the way I am answering questions is not the way people want it to look like, like here
I'd really like to improve my style of answering questions. What would you say that I should improve?
 
hello
 
hi Andras
 
I agree with hpaulj, I can't really see anything wrong with the answer.
But don't worry yourself about accepts: askers are often confused or don't even come back, so a lot of correct and upvoted answers never get accepted, and occasionally even wrong answers get accepted. That's just how it goes.
if an accepted answer is later unaccepted, that's a good sign of a chameleon
Looking at your rep history it's more likely that someone has a grudge against you. Do you ever get into arguments with other users?
 
Ok, thanks for your supporting words.
Yeah, I guess not getting accepts is quite common and happens to everyone.
I didn't know that the term chameleon existed. Sounds like a good description. The chat-system hint is a good idea, I'll try to use it the next time. :)
Hmm, possibly. I had a discussion with one user where I felt wrongfully accused. I'll look it up and post the link.
 
@Scotty1- Only suggest chat if you feel like holding the hands of the asker in their endeavours. If they come back a month later with something substantially different, it's usually simpler to tell them that they shouldn't completely change their question in a way that invalidates existing answers, and roll back
@Scotty1- okay though I'm not sure I'll be able to say much beyond technical correctness of the given answer
 
11:59 AM
I guess this one [here](https://stackoverflow.com/questions/51137373/is-numpy-broadcasting-associative/51138077#51138077)
There was another post of user which got deleted where he stated that he gave me "another downvote". Honestly my reaction to his "here is another downvote" wasn't the best...
 
Which user do you mean? The asker or the other answerer?
 
the other answerer
 
Your comments don't exactly come across as friendly, frankly
> Thus my answer is correct, fully independent of broadcasting. That's just how math is. But thanks for downvoting anyways.
Is double-precision multiplication associative? I'd be surprised. Which would make your answer _in_correct
 
Yep, that's what I mean with that my reaction wasn't the best...
Yeah, it may be true that the answer is incorrect, thus I think the downvotes are correct. But what angered me was the (now deleted) reaction of user that he (somehow? with a second account?) told me he gave me a second downvote...
 
perhaps they meant that there was an existing downvote and they gave another one
 
12:06 PM
that sounds like a possible explanation... So I guess I should improve my way to react in such discussions...
Oh and I just tested it for a random number of floating points. You are right, floating point precision makes my answer incorrect.
 
Yeah. Rule of thumb: don't accuse others of downvoting your posts, and don't be passive-agressive. Worrying about downvotes is often pointless. When the downvote really doesn't make sense it might help asking for a reason, hoping that you missed something obvious. But for that you should be technical and dispassionate.
 
Ok, thanks. I'll do that. I guess I had a phase of frustration due to having several correct answers without upvotes or accepted answers and was thus trying to enforce things...
I was asking for the reason of downvotes in the past, because I thought a small hint may make it easy to improve my answer, since I was already there to try to help. But I hardly got a helpful comment...
 
Yeah, it often doesn't help.
 
12:21 PM
Yep, thanks again for your advice!
 
no problem
 
Oh sorry, one last thing: Should I flag chameleon questions?
 
If the change is substantial, roll back and instruct the OP not to do that. If they edit again, leave a custom mod flag. Rolling back twice is the start of an edit war.
if the change is smaller you can just walk away
it's not an exact science, use your judgement
 
I guess I'll just avoid the stress by ignoring the question. Thanks again!
 
no problem
 
 
1 hour later…
1:41 PM
\o cbg
 
Yo
 
how goes it on this heated Monday?
 
My alarm didn't go off today, but because the office more or less follows a policy of "just be here for the noon-ish meeting and work 8 hours a day", there won't be any consequences other than not getting to go home as early as usual
 
is waddling a subset of slithering ?
 
I don't think so but I can imagine a category that encompasses both
"forward movement requiring sinusoidal lateral movement"
 
1:55 PM
because slither = "move smoothly over a surface with a twisting or oscillating motion" and waddle = "walk with short steps and a clumsy swaying motion" but waddle could be a smooth oscillating motion...
 
smooth and clumsy I feel are mutually contradictory
Possible counterpoint: that one animator that draws very fat birds
 
drunken fist is a smooth technique that incorporates clumsiness.
 
DSM
Morning cabbage for all!
 
morning DSM, hope you staying hydrated.
 
I thought I'd be able to find a sample of his work but google's coming up dry. Maybe later.
 
DSM
1:59 PM
"No, l in list and l not in list cannot both be true for a given pair of l and list" <-today's assignment: create a counterexample
@MooingRawr: I wanted to work from home today but with no A/C I decided to come into the office.
 
Problem's difficulty varies depending on what type list is
 
DSM
No tricks there, it's a standard list.
 
wise move, as always, I had the unfortunate experience of a public train with no AC on a summer day, that was a nightmare. also ohh puzzles :D
The first No, is tripping me up
 
DSM
For the record, I don't know if it's possible. My first thought, playing games with __eq__ so the second time it doesn't behave the same way as the first, is blocked by the fact that identity is tested before equality in list membership.
 
sorry I still don't follow, are we looking for I and some list where I in list != True and I not in list != True
 
2:05 PM
A strict interpretation of the challenge would be to look for the opposite: when both are True
 
yup was just wondering what that first No, meant lol
 
I expect finding a case where both are false is approximately as difficult, and one may lead to finding the other
 
I'm wondering if we can override it with some xor....
 
Before you go down that rabbit hole: You can't reassign list.__contains__
 
Does this count?
 
2:17 PM
class PartialLiar:
    """
    instances of this class give an incorrect answer to `==` every other time it is compared.
    """
    def __init__(self):
        self.honest = False
    def __eq__(self, other):
        self.honest = not self.honest
        return self.honest ^ (self is other)

a = PartialLiar()
list = [23]
print(a in list)        #True
print(a not in list)    #True
Initially tried list = [a] but I ran into DSM's "list first checks identity before calling __eq__" problem
 
DSM
Oh, I should have thought of that.
 
Which is curious, because I can clearly see that occurring in my list = [a] code, but I don't see in the CPython source where identity checking happens. AFAICT list.contains simply calls the eq operator on its contents.
Possibly it does another pass earlier in the code base somewhere in order to do identity checking, but it's curious to me that it's not just in the body of the function
 
@Kevin wait you cant, oh wait,nvm I was going to create a subclass of List.... and override it there.
Oh what a neat solution, I was thinking of changing the right side not the left side. neato
 
Now let's argue about whether "x is a standard list" implies that x's type is list, or if it only implies that isinstance(x, list) is true
 
@Aran-Fey what in monstrosity have you created lol..
 
2:25 PM
Inspecting the contents of other frames is next-level dark magic
 
DSM
I think that magic counts too.
 
morning cabbage
 
It's a nice approach because, unlike my approach, you can't foil it simply by repeating each test more than once in a row
 
i get a TypeError: 'NoneType' object is not subscriptable when running Aran's code
 
Probably a version problem. inspect is pretty implementation-dependent
 
DSM
2:29 PM
Okay, I did it myself in a different way: ugly.
 
Backup explanation: the IDE is doing something weird to your frames
 
DSM
The moral of the story: chepner probably spoke too soon. ;-)
 
u should submit your answer
:D
but then it doesnt directly answer the OP :\
 
DSM
Of course not, this was a tangent purely explored for silliness reasons. :-)
 
well TIL a new thing
 
2:38 PM
Still an open question whether x in [x] can ever evaluate to False
Leaning towards "probably not" myself, based on what I've seen so far
 
DSM
I don't think so either.
 
Not sure what I did but I modify Kevin's solution, not sure if it did before the modification, it gives True True or False False changing x between 1 and 0 lol
 
Don't really need __eq__ there since that won't get called on the list object
 
2:54 PM
oh wait it doesn't work since other in self would create a recursion loop :\
sigh maybe ill change the storage of the list in the subclass, but then ehhh
 
Rather than using in directly, you could call __contains__ on the super() instance
But really, if we're trying to return nonsense values anyway, there's not much point in actually checking the list's contents
class PartialLiar(list):
    def __init__(self, *args):
        self.honest = False
    def __contains__(self, x):
        self.honest ^= True
        return self.honest
x = PartialLiar()
print(1 in x)       #True
print(1 not in x)   #True
 
@Code-Apprentice yes, but shouldn't they be consistent? i.e., program can change it, but the cmd line should then have the program's version. the cmd line can change it, but the program should then have the cmd line's version.
 
... Although now PartialLiar is a bad name, since this object lies all the time
if "ignoring the question and returning a predetermined response that might turn out to be correct by coincidence" counts as lying
 
recbg
@heather starting a shell comes with its own imports (import site?) so anything can happen
especially since help(site) says
Help on module site:

NAME
    site - Append module search paths for third-party packages to sys.path.
Then again you're probably talking about the shell $PATH rather than the python path. Still, anything can happen
 
3:18 PM
My jimmies are becoming disproportionately rustled by How to label matching items in a nested list in Python, which asks for output in "consecutive numeric order", but then the output contains 0, 1, 2, and 4
 
@AndrasDeak i see.
thank you =)
 
no problem
 
And the one test case provided doesn't disambiguate the requirements-as-stated from the requirements-you-might-derive-from-the-expected-output-provided
 
so close as unclear
 
@heather If a program changes PATH, the change will not be visible to the parent process (in this case, cmd). If cmd changes PATH then starts another program, that program will see the changes.
 
3:20 PM
@Kevin Also what does "I am trying to label each sublist starting from 0-25" mean?
 
It would help if he had phrased it either as "I have a list of length 25" or "I have a list of unknown length, but with 25 unique values"
 
That question is unclear but not quite unclear enough for it to be awful
 
Cabbage.
@MoxieBall It's annoying, but I guess the expected output makes the OP's intention clear... unless that 4 is a typo.
 
Exactly.
 
Here's a "cute" feature of zip I just stumbled across. I might've noticed this previously, but if so, I've forgotten all about it. ;)
 
3:28 PM
Well the difference between an answer that gives you a 3 and an answer that gives you a 4 is one level of indentation, so hopefully OP has what they need
 
>>> it = iter(range(9)); [*zip('abc', it), *it]
[('a', 0), ('b', 1), ('c', 2), 3, 4, 5, 6, 7, 8]
>>> it = iter(range(9)); [*zip(it, 'abc'), *it]
[(0, 'a'), (1, 'b'), (2, 'c'), 4, 5, 6, 7, 8]
 
I was about to say the same thing, re: indentation, but I'm second-guessing whether that's sufficient
Now third-guessing... I should approach the infinity-guessing event horizon by the time I submit this message
 
@PM2Ring the fact that it consumes it [the iterator] before it [the interpreter] realizes that 'abc' is over?
(s/consumes/steps/ but I don't want to keep pinging you)
 
@Kevin Yes, indenting count += 1 under the if seems to do the trick.
 
Yeah, I got tripped up because the answerer's implementation differed from my own because he constructed the result at the end and I constructed it iteratively. But there's no difference.
 
3:38 PM
@AndrasDeak Exactly. I guess it makes sense, it's not like zip can step through its iterables in parallel. And of course, we rely on zip processing them in order in the zip(*[iter(seq)] * rowsize) chunkify trick.
@Kevin It's Ajax. He always does stuff in a slightly quirky way. :)
 
His solution is three lines shorter than mine, and it's the same complexity, so I can't claim superiority in this case
If you don't mind going from O(N) to O(N^2), you can do it in one line with print([label_list.index(item) for item in label_list])
print(list(map(l.index,l))) for the code golfers in the audience
Doing it in O(N) and one line, left as an exercise to the reader.
I wonder if toolz.groupby is useful there...
 
rb folks
need to buy salmon for dinner
 
>>> (lambda d: [d[item] if item in d else d.__setitem__(item, i) or i for i, item in enumerate(map(tuple,label_list))])({})
[0, 1, 2, 1, 4, 1]
But this is unsatisfying because explicit mutation in a list comp is gross
 
DSM
3:54 PM
list(map((lambda x, codes={tuple(x): i for i, x in enumerate(OrderedDict.fromkeys(map(tuple, label_list)))}: codes[tuple(x)]), label_list))?
 
ooh, interesting.
I wonder if you can do it without OrderedDict. What's the complexity of reversed(list)?
 
DSM
Guess I don't need the tuple(x) in codes={tuple(x), that can just be x.
 
umm, anyone has a good link for pep8-like conventions for the new stuff (function annotations, etc.) ?
 
>>> (lambda d: [d[tuple(item)] for item in label_list])({tuple(v):idx for idx,v in reversed(list(enumerate(label_list)))})
[0, 1, 2, 1, 4, 1]
 
DSM
I really prefer the 3 there, though. :-/
 
4:00 PM
Oops, we're solving different problems :-P
Subtly revealing that I only read code thoroughly enough to steal cool ideas, not enough to know what it's actually doing
 
Hi, Ajax. Did you hear us talking about you? :)
 
Ajax shows up pretty regularly, actually
 
Despite my previous remark, I think your answer's fine, and worth an upvote. Shame that the OP has disappeared.
 
# Option 1
@dataclass
Class Number:
    val:int = 0

# Option 2
Class Number:
    val: int = 0
okay, what do you guys prefer? with space, without space?
(or something else)
 
In a class, definitely with a space. In a parameter list... idk
 
DSM
4:10 PM
Has to have a space in both situations, I think.
 
and in a parameter list? (Assuming space goes well in the above example)
 
The only place I don't put a space after a colon is in slice notation.
 
also after block-opening colons ;)
 
def A(val:int, val2:str): # option 1

def A(val: int, val2: str): # option 2
 
I suspect always spaces
 
4:13 PM
def A(val :int, val2 :str): # option 3 :)
 
DSM
(shudder)
 
an assignment in there would definitely screw things
so much for readability...
(or maybe it's just something we need / have to adapt to)
Imagine all this with the new PEP 572...
3.7 will be the new 3.0
 
if assignment expressions are a thing I want ++x
 
After some thought, I think I'll prefer no space in both scenarios, easy to distinguish the variable at least. Or maybe just won't use type hints unless really needed.
 
@shad0w_wa1k3r the black module outputs option 2
 
4:22 PM
@piRSquared Ooh, thanks, good to know, will try it against some tricky combinations
 
@shad0w_wa1k3r welcome to type hints
The upside of 572 and type hints as you can ignore them and use real python if you want to. That's not something that was an option with 2 vs 3.
 
@AndrasDeak Hmm, I wonder what AD's opinion is on 572?
 
Maybe it's not the incompatibility that will be the issue, but the lack of use. Let's see, maybe I should just ignore these things for a while and wait for some general adoption (if any)
 
@Kevin The more math you've learned, the more math you've forgotten.
 
@piRSquared it isn't exactly a secret
 
4:37 PM
(-: just find the "real python" bit funny.
 
last few messages here for instance
Ah, it was rhetorical. Sorry, long day
 
I've been guilty of writing (lambda x: x + 2 ** x)(sum(map(lambda y: y ** 2, range(5)))). With 572, it should be (x := sum(map(lambda y: y ** 2, range(5)))) + 2 ** x which is sooo much better.
 
What server should I use for Python machine learning
NodeJS vs PHP vs Python
 
@piRSquared XY problem?
 
If you want to do Python machine learning, I bet Python would be good for that
 
4:49 PM
I wanted to use PHP because whenever I tried using NodeJS the process keeps dying on me. But NodeJS seems like the best choice. People say don't use Python for server but then I might as well use Python if the machine learning code is written in Python so that I don't have to keep spawning Python processes...
 
heh
rhubarb for a while
 
Ok Python then
To deploy a Python machine learning API
 
@AndrasDeak fabricated example to highlight some ridiculousness. Even though I kinda like the pep, I don't think I'll use it often. However, it seems similar to comprehensions in that it is several style guides to avoid comprehensions, at least complicated ones. So that translates to updated style guides stating "Please don't be silly with your assignment, expression thingies".
 
@hexicle guess what is so superior about JavaScript on the server compared with Python? It is the same cr*ppy language throughout...
@hexicle then guess what is so superior about PHP on the server compared with Python? It is so easy to copy-paste security holes from the interactive documentation...
 
Ok ok I'll use Python
 
5:15 PM
Yesterday I spent fifteen minutes debugging a program on my home computer before I finally discovered that sys.argv always had the same contents regardless of the command-line arguments I provided
It works correctly when I do python myscript.py arguments_go_here, but not when I do myscript.py arguments_go_here
Something's wrong with my file type associations, I suspect
 
let's golf: Python 3.6. Most concise way to get first key of a dictionary.
best I got is next(iter(d))
 
list(d)[0]?
 
^ looks like a winner to me
 
yeah... I think the standard prize is 4 Quantloos
 
And if the dict is empty?
 
5:23 PM
Have we made that the official currency of room 6?
@AndrejKesely boom! way to throw a spanner in there.
 
Now what's the most convoluted way to get the first key of a 3.6+ dictionary
 
[*d][0]
 
Nice.
 
(lambda x, *y: x)(*d)
 
performance-wise, would iter be better for large dictionaries?
 
DSM
5:26 PM
@AndrejKesely: wow
 
@AndrejKesely that's gonna be tough to beat
 
I might double the prize money for that
 
Are we not considering empty dicts? In which case piRSquared's latest would be the "best" convoluted?
 
ok, how about for the first value of the dict?
 
DSM
d[[*d][0]], with apologies to AK?
 
5:30 PM
@MoxieBall d[[*d][0]]?
 
never mind, that's just three extra characters, no fun
 
@piRSquared (lambda x, *y: x)(*{**d})
 
@DSM Nice :)
I think i will use it to answers for users with reputation 1 :D
 
@shad0w_wa1k3r I imagine we could stack unpacking, maps, and lambdas to keep adding to the convolution (-:
 
same, could go deeper, but there's no bottom to this IMO...
 
5:37 PM
this works too (lambda x, *y: x)(*{**{**{**{**{**d}}}}})
 
yeah, that's why I said there's no bottom because you can irregularly (for the convolution) stack multiple such redundancies
 
My worst way to get the first key entry: eval(repr(d).split(':')[0][1:])
 
@MoxieBall that's pretty terrible
 
DSM
There should be some kind of ugliness-per-unit-character normalization, though.
 
Jun 29 at 16:14, by piRSquared
let's golf: Most concise way to print out the keys of a dictionary and nothing else except white space.
Jun 29 at 16:17, by vaultah
print(*d)
Almost the same
 
5:55 PM
In high school I was given a writing assignment that had to be exactly 277 words... print the first key of a dictionary named 'd' in 18 characters.
 
DSM
With no whitespace, presumably.
 
yes, and preferably no repetition like {**{**d}}
 
DSM
[*d][1//234567890]. :-P
 
I guess I'll just keep imposing more specific restrictions until someone gives me the answer I want
list({**{**d}})[0] is also 18
not what I was thinking of though
 
How about asking it like this
print the first key of a dictionary named 'd' in 18 characters in the same way that I'm thinking.
 
6:05 PM
Yeah, that's perfect
I think the "do x in exactly n characters" challenge is not as popular as golfing for a reason
 
I wonder if "print the first key of a dictionary named 'd' in 18 characters, without repeating any character" is possible. Bit tricky since you only get one pair each of the square brackets and parentheses
I got as far as
>>> d
{1: 2}
>>> a,*b=d;a
1
 
6:21 PM
you used 'a' twice, though
 
DSM
tuple(d)[0*123456]
 
that's the work in progress part.
 
DSM
Guess I could have used list there and added a 7, but this reveals a little bit of my development path. :-P
 
a,*b=d;eval(chr(97)) (20 characters though)
 
Mine's a dead end, I think. I don't think you can access a name using characters other than the ones you already used. Not even _ is useful here, since that presupposes that you already have an expression that evaluates to the value you're trying to get to
And using eval plus any sort of string building almost certainly requires more than one pair of parens
Hmm. Unless...
 
6:25 PM
cbg
 
Oh right, parentheses... oops
 
>>> a,*b=d;eval(f"{10:x}")
1
Bah, 23 chars. Oh well.
Whoops, doesn't matter anyway since there's two quote marks
Python devs, please support “Smart quotes”
 
DSM
Ouch, that kind of kills any stringlike approach.
 
If only globals and locals didn't have 2 l characters...
 
the zip list, iter keys problem is annoying as well
 
6:29 PM
I think asterisks should work even in the middle of a word
asterisks u__nderscore__s
 
lunchtime cabbage!
 
DSM
Those of us who need to multiply things may want to object.
 
that's what whitespace is for
 
Hmm, maybe you could do eval(str(some purely numerical expression goes here that evaluates to float("NaN"))[1])
Am I complicating this by trying to find an expression that evaluates to "a", when really I can literally use any character or sequence of characters I like, as long as it's a valid identifier
 
eval(str( has two (s
 
6:37 PM
But suppose it didn't.
 
clearly python needs other ways to call functions, ones that don't require parentheses. Anyone wanna write up a PEP?
 
simply make a b equivalent to a(b), what could possibly go wrong
 
DSM
Wasn't that actually considered at one point by Guido?
 
It's not the most insane possible feature.
 
PEP 572.5
 
6:52 PM
Back from Chipotle and no e-coli... that's a win fellas!
fellas in the gender neutral sense.
 
Got real excited when I determined I could access an identifier-legal sequence of characters without repeating any characters by doing quit.name[1], but alas, I can't use that and eval since they share vowels.
 
huh. Why exactly does quit have a name and an eof attribute?
 
One million demerits to credits for looking like a string, but not actually being a string
 
repeats but 18 chars
next(a for a in d)
 
7:07 PM
> All identifiers are converted into the normal form NFKC while parsing
Ah ha.
>>> d = {1:2}
>>> ℍ,*b=d;H
1
Thank you DOUBLE-STRUCK CAPITAL H
I wonder if there are any unicode symbols whose NFKC normal form is parentheses. I would try to check programatically, but How can I iterate over every character in a given encoding using Python? looks specific to 2.7
 
Hi all, I came here for the first time.
what's chat room rules?
and what are we doing we should?
 
Oh, I can just use chr instead of unichr, duh
⁽ SUPERSCRIPT LEFT PARENTHESIS
₍ SUBSCRIPT LEFT PARENTHESIS
︵ PRESENTATION FORM FOR VERTICAL LEFT PARENTHESIS
﹙ SMALL LEFT PARENTHESIS
( FULLWIDTH LEFT PARENTHESIS
⁾ SUPERSCRIPT RIGHT PARENTHESIS
₎ SUBSCRIPT RIGHT PARENTHESIS
︶ PRESENTATION FORM FOR VERTICAL RIGHT PARENTHESIS
﹚ SMALL RIGHT PARENTHESIS
) FULLWIDTH RIGHT PARENTHESIS
Python doesn't recognize them as valid tokens, as I suspected. Just wanted to check.
 
I have since quit on getting a 18-char solution with no repeating characters that doesn't do it the way DSM did
 
7:22 PM
Yeah, he pretty much closed the case.
But if I didn't occasionally adopt an attitude of "There is a point where we needed to stop and we have clearly passed it but let's keep going and see what happens", then I'd never get anything done
If nobody ever beat a dead horse, then we'd never have invented glue
 
list(d)[0]#abcefgh
I kick dead horses to avoid zombie horses.
 
But if we do have a zombie apocalypse, they'll hunt kick you first!
 
Hmm, not sure if zombie horses are scarier than zombie humans. On one hand, they're fast and bite harder. On the other hand, zombies are famously susceptible to detachable limbs, and horses are famously susceptible to not being able to move unless they have all their limbs. So that seems like a problem that solves itself.
 
okay so, one less thing to worry about. phew.
 
If you can survive the first two seasons of Horse Walking Dead, then you're probably good, having exhausted the supply of fresh zombie horses
Then they're only as dangerous as immobilized zombie humans, which is to say, still dangerous but only to characters that the writers want to kill off in an undignified fashion
You're on ordinary supply run #2342 and you trip into a ditch and whoops, there's a three legged zombie horse
 
7:46 PM
Also live horses act like zombies anyway
 
hi sixers
 
whaddup
how is everyone doing
 
currently overthinking decode and encode meaning. bytes to str being "decode" sounds off
isn't it the utf-8 encoded string, that should be... encoded?
as in, b'bytes' are bytes, and we encode these bytes as utf-8 to get a utf-8 encoded thing
... except that's not how the methods are named. halp.
 
01:00 - 20:0020:00 - 00:00

« first day (2823 days earlier)      last day (2128 days later) »