« first day (2671 days earlier)      last day (2295 days later) » 

wim
12:13 AM
No. That would not be a good use of time.
 
:(
I guess I'll spend that time writing monkeypatches for sphinx then. I really can't make this thing do what I want.
 
anyone install Intel's python distro? is it anygood? I'm running rather low on storage and it takes a decent 2gigs to instal 3.X and 2.X together.
 
12:38 AM
Thanks, autodoc. That's very readable.
 
Thank annotations :P
 
True, that's part of the problem. It looks better in the code though, because not everything is prefixed with typing.
I see 4 options now: 1) Accept this ugly mess. 2) Write everything manually. 3) Write my own autodoc. 4) Forget about documentation.
None of these seem great
 
~~~ forget about annotations ~~~
I'm gonna stop
 
I can hardly not annotate my introspection module that heavily relies on everything being annotated :D
I guess a monkeypatch to remove the annotations will do for now
^ my experience with sphinx summed up in one sentence
 
1:17 AM
I have this function :
```
from __future__ import division

import os


f = open('manifest.txt', 'w')
# run it from folder that has all training files
for root, dirs, files in os.walk('./'):
for newname in files:
filename = os.path.join(newname)
newstring = filename + '\n'
f.write(newstring)```

How do I put this in a function and a class.
 
I don't think that belongs in a class
Anyway, what exactly is the problem? Do you not know how to define a function?
 
I can do this :
```
from __future__ import division

import os
def main():
create_manifest_file()

def create_manifest_file():

f = open('manifest.txt', 'w')

for root, dirs, files in os.walk('./'):
for newname in files:
filename = os.path.join(newname)
newstring = filename + '\n'
f.write(newstring)

main()```
 
You may want to read this :)
 
Ok thank you i'll take a look.

In my mind I wanted something like this :
``` from __future__ import division

import os

class ManfiestCreator(object):
def create_manifest_file(blah blah):

f = open('manifest.txt', 'w')

for root, dirs, files in os.walk('./'):
for newname in files:
filename = os.path.join(newname)
newstring = filename + '\n'
f.write(newstring)```
 
Except for the blah blah, that looks like it should work.
 
1:33 AM
When I put the class and def ManfestCreator, and I run that in a directory nothing happens. but there is no error message either. So confused what to do.

But If I remove class and def and re run , it creates a file with list of all file names in it.
 
Well yes, all you've done is define the class. You never instantiate it and call its create_manifest_file method.
Try adding ManfiestCreator().create_manifest_file()
 
 
6 hours later…
7:20 AM
@Aran-Fey you see where your friendly manners got you?
 
7:31 AM
Where?
cbg, folks
 
cbg yall
 
7:50 AM
https://stackoverflow.com/questions/48637148/docker-postgres-sqlalchemy-could-not-connect-to-server-cannot-assign-reques?noredirect=1#comment84282949_48637148

Pointers anyone?
Another unrelated question: I get a key error when trying to read enviroment variable using os.environ['varname']. Even though I can read it from the bash shell using echo $varname. Any idea why that's the case?
 
@Ajit no, but thanks for making me aware of the ultra cool feature of healthchecks and depends_on.condition
@Ajit The yml has options for env and envfile I think, that should do the job (os.environ is never wrong).
 
@AshishNitinPatil no problem, but that didn't work .. oh well .. thanks for trying though
 
8:08 AM
@Ajit Umm, your bash shell might have several variables, that may not be directly available to os.environ depending on how it's launched (hence affecting the environment).
container:
    env_file: .env
    environment:
      - MY_DOMAIN_NAME=example.com
This way is explicit, and the recommended way of adding things to your env. Then you can simply add key-value pairs to your .env and the os.environ would pick it up just right. (given that you rebuild after you change the .env)
 
@AshishNitinPatil Oh no that's was a different question. I am not using docker in this case
I am on ubuntu 16.04
 
That'd need much more context then, because depending on your setup, the answer will change accordingly. See the comment above the yml code.
 
@AshishNitinPatil You're right when I 'export' the variable in the shell, i can access it using os.environ
I wonder why I can't read them from .bashrc
 
> You put things in ~/.bashrc that would not be inherited by subshells automatically; this means aliases and functions, mostly, although sometimes you have variable settings that you don't want visible outside the shell (this is very rare).
 
@AshishNitinPatil That makes it clear, thanks
 
8:45 AM
cbg
 
9:04 AM
@AshishNitinPatil "although sometimes you have settings that you don't want visible outside the shell" is quite common - and it includes aliases and functions
 
Is there a consensus why set-syntax like ^ | - was not introduced for dictionaries as well?
 
Eh? What would it do?
work with set(mydict)?
 
the same
except what would the union do
 
no, i mean between dictionaries
 
yes, but what's the intersection of {1:2} with {1:3}?
 
9:16 AM
exactly
 
that's the one problem, but I personally could live with "the latter overrides the former"
 
you could "live with"
 
^
it would be a yamshow
 
I just find myself wishing to write these kinds of operations in one line instead of temps
 
you can also live with that :P
 
9:18 AM
seriously, there are enough tshissy ideas implemented in Python. We don't need more
like, who in their right mind decided that relational operators are a good match for superset/subset ops.
 
you can always subclass dict ;)
@AnttiHaapala actually there's a lot of similarity there
strict subset/supersets give you a strict ordering just like > does
 
@AndrasDeak yes they do... but that is not the reason to use that
since they're not the same, notably, they're not stable
 
what is the reason then?
Stable how? As in sorting?
 
@AndrasDeak I just won a fight in our team this week where I purged ~30% of all classes from the project. If I subclass a native I'll have a mob in front of my office before lunch
 
then you'll just have to use from dictops import dict_diff,dict_or
 
9:21 AM
@AndrasDeak for example
the sort contract operates with relational operators.
so now you suddenly can sort sets, but it doesn't mean anything
>>> sorted([{2,1}, {2,3, 4}, {-1,2}])
[{1, 2}, {2, 3, 4}, {2, -1}]
I'd prefer that to throw
 
ah, because unlike reals it's not true that any two items are in relation
 
the some odd code that does some set membership should have used issuperet/subset instead.
>>> sorted([{2,1}, {-1,2},  {2,3, 4}, ], reverse=True)
[{1, 2}, {2, -1}, {2, 3, 4}]
 
but it's your fault for trying to sort a set of sets that aren't mutually contained by each other :D
I guess if you do that for a telescopic series of sets, it'll work, because any two items will be in relation
(or however one says that)
 
so again it was some guy: "Hey last night in toilet I hit my head on the sink and invented the flu... no actually that we can use the relational operators for set membership"
@AndrasDeak no, it is not my fault, because Python (but not Pythoff) actively forbids this nonsense in all the other cases but...
 
it does? oh, "in all other cases"
 
9:26 AM
>>> sorted([{}, {}])
yes, in all other cases
that I've come up with in the 3 years I've thought about this.
the only other sortable things in Python 3 core are those that can be put in lexicographical or magnitude order.
 
so why no bug report? :D
 
>>> 1j < 1j
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: '<' not supported between instances of 'complex' and 'complex'
because it is not a bug, it is a feature and I am just being stupid
while the person who committed this feature into the core is a genius
 
Well if you look at just comparisons, it's a feature. If you look at sorting, it's a bug. Current sorting with current comparisons is definitely a bug.
 
oml, I did not know inequality operators could be used to perform set comparisons
 
ah of course there is the other thing: sorting nans
 
9:29 AM
I did but I didn't wonder about the consequences
 
since the idiocy that the < is used for...
 
features are gathering for python 4 ;D
 
well, the IEEE does have a comparison algorithm for numbers that will stably sort nan values too.
but no one cares about that odd nan there
 
wim will tell you that nans themselves are the problem
 
cheese nan is the best
 
9:30 AM
@FlorianMargaine wat is this sacriledge.
garlic nan
 
garlic
 
I retract my previous statement of "I wish set operations existed for dicts"
 
:D
good!
 
9:32 AM
they should be purged
 
yes, I know garlic, I use it in some meals.
 
@ArneRecknagel anw, union does now exist with
{**a, **b}
and since it is ordered then you can decide which one overrides which
 
@AnttiHaapala This pretty much covers 99% of my uses anyways
 
@ArneRecknagel you may step down from the stocks
 
@AnttiHaapala Oh, was it added already?
 
9:33 AM
so how about getting in @IljaE's dict-destructuring patch
 
@ArneRecknagel cpython implementation detail in 3.6, python in 3.7
 
@AndrasDeak no, the **a, **b is always ordered
 
is it? not just kwargs?
 
or is that kwargs
 
9:34 AM
no I mean that the b's override a's
 
I don't think of the dict literal as a function call
 
>>> {**{1:2}, **{1:3}}
{1: 3}
>>> {**{1:3}, **{1:2}}
{1: 2}
>>>
 
"literal"? I don't know
 
and people say python is simple
 
python is powerful.
 
9:35 AM
>>> {**{1:2}, **{1:3}}
  File "<stdin>", line 1
    {**{1:2}, **{1:3}}
      ^
SyntaxError: invalid syntax
*runs away*
 
@AndrasDeak slap
@AndrasDeak you're using an eoled version
hmm python3.7 minimal available ?!
 
hey it still has almost 2 beautiful years ahead of it
with almost 1 year of numpy support
 
@AnttiHaapala what I find confusing is that you can't transform this into a dict() call, even though it looks as if you should be able to
dict(a=1, a=2)
  File "<input>", line 1
SyntaxError: keyword argument repeated
 
I would've sworn that works
 
yes, but you can repeat it in **
 
9:37 AM
ah, that's why
 
except
>>> dict(a=5, **{'a': 6})
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: type object got multiple values for keyword argument 'a'
 
>>> dict(**{'a':1},**{'a':2})
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: type object got multiple values for keyword argument 'a'
3.5 and 3.6
 
you can't
:D
 
it might work in a function call....might be a C thing
 
dict() != {}
 
9:38 AM
damnit
 
nope
 
I could've sworn that
 
me too, are we being dumb?
we need Martijn
 
@AndrasDeak It's not you, it's python :p
 
Cabbage
 
9:42 AM
cbg
 
I don't understand why one would expect dict(**{'a':1},**{'a':2}) to work.
 
@Antti and I were victims of the Mandela effect. We both thought that foo(**kwargs1,**kwargs2) works and overrides the keys in the former with corresponding values from the latter
it does work, but refuses to guess
it's snowing! \o/
 
@PM2Ring I wanted it to work because {**{'a':1},**{'a':2}} works
 
9:48 AM
My guess is that {**{'a':1},**{'a':2}} was added to Python because dict(**{'a':1},**{'a':2}) can't work. ;)
 
huh, accuweather put up an anti-adblock wall
I guess I'll have to not visit a website that tracks its users :P
 
@AndrasDeak wat
 
it's +1 feels like -3 degrees, ideal for snow
 
I'm tempted to ask Willem not to modify the OP's code like that (in mydict he converted naked A, B, C to 'A', 'B', 'C'). I guess it's what the OP probably meant, but still...
 
yup
 
10:00 AM
The weather's been glorious here for the last week or so: 20-25°C, with a little rain every couple of days, mostly in the evening. A couple of weeks ago we had a few days >40°C which weren't a lot of fun.
 
Germany got back to snow after forgetting it was winter for a couple of weeks
I was already starting to miss my winter depression, so glad the weather came around for an encore
in other words, I envy you PM
 
@PM2Ring I can't even imagine that kind of heat...
well, I can, because we regularly have 36 degrees countrywide in the summer, but I wouldn't even wish that for my enemies
@ArneRecknagel same here, then again there's pretty strong correlation between your weather and ours
 
@AndrasDeak I heard houses on the other side of the pond all come with AC
 
but that's the other side of the other pond, and surely that can't be true anyway
 
To be honest, once it gets past the mid 30s it's hard to tell exactly how hot it is, apart from the increased tendency to avoid anything more physically strenuous than lying around. :)
 
10:08 AM
You were central europe, right?
My only source is the baffled expression of an American when he heard my house didn't have one and I open my windows like some kind of neanderthal
 
@ArneRecknagel yup
have you considered the fact that the expectations of a random American don't exactly correlate with reality?
 
I've been spoiled by having air-con for the previous 7 years. There's no air-con in this house, but we're close to the coast, and there's almost always some kind of sea breeze.
 
something something "stop being poor"
 
@AndrasDeak hah, come to Dubai. Average summer is 45C+
 
but you do have AC everywhere there, right? :P
 
10:15 AM
everywhere
 
plot twist: the natural temperature is 30 but all those ACs are heating it up to 45+
 
sorry to jump in so suddenly but i have a problem that i cannot solve. I have django admin template and inside that i need to add a filter between 2 dates(like the default filter you can place on a datetime field inside the model) but in my case i want to filter based on date that is inside another model(table)
0
Q: Djagno admin add custom filter

Proxyi'm using django 1.10 and i need to display data and create a filter based on a value from a different model(which has a foreign key referencing my model that is used on the admin template) These are my 2 models: This one is used to generate the template: class Job(models.Model): company = model...

 
My understanding of physics made a jump when I understood that fridges/ACs don't actually 'produce' coldness and just move heat between places
 
@AndrasDeak na, you'll easily see the reality when you stand outside for 30 seconds.
 
i have managed to extend it via the simple list filter
but then im unable to add a datepicker
 
10:18 AM
@Proxy it's explicitly fine to jump in here with unsolved older questions. I added the tag for you; always have the generic tag
 
@Proxy You need to fix the indentation in your question code, so that it's more readable.
 
right, that too ^
(I didn't read beyond the tags)
 
i tried but for some reason it won't work...
 
try harder ;)
you can see the preview below your edit box
if you lose levels of indentation you have to fix that manually, a button won't do that for you
 
aha yeah i could have done it manually... sorry
 
10:22 AM
@Proxy You can select the text you want to show as code and press CTRL + K
 
i see. thanks, i went to edit it manually but you were faster. thanks.
 
@Proxy the start_date goes in the admin class right? I mistook it to be outside for some reason. Fixed.
 
is the question clear?
 
I'd suggest that @Proxy themselves check that the current formatting in the question corresponds to their real code (that's why we prefer not to indent the code of others, @Ashish)
 
it is okay now
 
10:27 AM
@AndrasDeak I was just making sure, otherwise he'd have other issues.
@Proxy yes.
 
@AndrasDeak pffffft. I wouldn't call that a productive use of my time
 
i see, i'm going to start a bounty so if anyone can help :P
 
not tagging it with generic probably cost you some views
 
we are running on 2.7 so i kind of just put that tag
wanted to keep it a bit more specific
 
yes, then you use both the generic and the versioned tag
11 mins ago, by Andras Deak
@Proxy it's explicitly fine to jump in here with unsolved older questions. I added the tag for you; always have the generic tag
 
10:30 AM
@Proxy Right, but you also need the generic tag, or many people simply won't see your question.
 
i know now :P. thanks for the help.
 
no problem
 
> If you have a version-specific Python question, consider using the [python-2.7] or [python-3.x] tags in addition to the [python] tag.
 
that info assumes that you look at [python] to begin with :P
 
yeah, that's what is bugging me.
 
10:31 AM
the 2.x excerpt could use some work along these lines
3.x is fine
 
It's there under "Tagging recommendation" though :/
 
yeah but that's not in the excerpt
 
I'm conflicted between what should be in it, and still it remains short.
> Do not use this tag if your purpose is to only convey the version of python you're using. Use the more generic [python] tag instead.
 
IMHO, it would be good if we only had , , and , we don't need the other version-specific tags.
 
@PM2Ring I don't know, will be quite different, same as
 
10:36 AM
And it would be wonderful if the python-3.x, and python-2.x tags were synonyms for python, so the generic tag wasn't necessary.
 
Surely, tag hierarchies have been discussed on meta already?
 
@AshishNitinPatil Sure, python 2.6 has some important differences to 2.7 (the latest version of Python 2 on this machine is 2.6.6). BUt I don't think we get enough new Python 2.6 questions that they warrant their own tag. The OP can just use the 2.x tag and mention the specific version in their question body.
@ArneRecknagel Yes, they have. And I get the impression that we aren't getting them anytime soon. ;)
 
11:02 AM
@PM2Ring as in if someone searches for C++ they will also see C++-11?
 
@kush Ok, I admit that tag hierarchies aren't a perfect solution, but I think that they would be better than the current system. At least, they would be for Python. :)
 
I wasn't trying to show shortcomings, just trying to understand (:
 
can anyone explain dynamic form composition?
 
11:34 AM
Aww, it seems that the Falcon Heavy middle core was lost. I want to see a video :P
 
11:46 AM
@PM2Ring: yup, the * was wrong. Lack of sleep / caffeine / too much travel.
 
@AndrasDeak Seeing the Tesla roadster being gifted to the autobots, the decepticons made a move and captured the middle core. It's all a giant secret being kept from the public.
 
@PM2Ring: I think you didn't mean to use *lst either. :-P I've edited your comment to remove the *.
 
Martijn, do you have any idea why Antti and I thought that foo(**{'a':1},**{'a':2}) would work, overwriting the former kwargs with the latter?
beyond the obvious "you're dumb" reason :P
recurring keys seem to be forbidden both inside {} and in function calls, but we were both sure that it works
 
You are asking him about what he thinks about you 2 thinking about such a thing? :p
 
well my point is that there might be a similar special case that does behave like that, and we're not entirely dumb
 
11:50 AM
@MartijnPieters No worries. I was just about to submit an answer when I noticed the question was closed. Serves me right for not doing a dupe search. :)
@MartijnPieters Oops! That happened because I tried your version before I made my comment. Oh well.
@AndrasDeak My theory is that you guys just got confused because {**{'a':1},**{'a':2}} works as desired.
 
it could be, although I don't remember ever using that
 
Fair enough, although IIRC it was discussed in here when that feature was added to Python.
 
I was aware that it worked like that, passively
python.org/dev/peps/pep-0448 2013, way before my time :)
> Currently, if an argument is given multiple times — such as a positional argument given both positionally and by keyword — a TypeError is raised. This remains true for duplicate arguments provided through multiple ** unpackings, e.g. f(**{'x': 2}, **{'x': 3}), except that the error will be detected at runtime.
I guess we're just dumb :P
> Whilst *elements, = iterable causes elements to be a list, elements = *iterable, causes elements to be a tuple. The reason for this may confuse people unfamiliar with the construct.
hehe, great way to confuse people
 
12:10 PM
@AndrasDeak Ah, right. I guess I only really learned about it after I switched to Python 3.
 
when I ported my python 3 Monte Carlo to 2 I missed extended unpacking the most
@PM2Ring "This PEP was accepted by Guido on February 25, 2015", so 2015 I guess, sorry
 
1:00 PM
I'm just waiting till they test out the conditions and mileage it gets on Mars, once they perfect that, I'll probably get one. (Hoping Elon doesn't start a race to Pluto anytime soon)
 
1:32 PM
Cabbage....
 
cabbage @Anarach
 
[tag:dup-pls] This: https://stackoverflow.com/questions/48665083/import-python-file-within-a-different-parent-directory
is a duplicate to this: https://stackoverflow.com/questions/4383571/importing-files-from-different-folder
 
I am trying to learn this data science course and I have an error which I cannot fix..Makes no sense.
Its like intro code in seaborn website
 
If you want to show lots of code (more than 10 lines), please use an external page like dpaste
moderators usually clean large text posts
 
ok...
 
1:38 PM
np
 
Lol.. Pastebin /dpaste does not work on my network
Wonderful :-D
 
github gist
 
Apparently tags dont stick after you edit a message?? Interesting.
 
they do
but you put a second line there
chat abandons all formatting for those pesky multiline messages. I ran into the exact same "feature yesterday"
 
@ArneRecknagel Interesting. Good to know. I dont see it in the cv-pls rule wiki, might be something to note on there sometime.
 
@ZackTarr chat formatting doesn't belong on that wiki IMO
 
This is my dataset
The error message does not state what exactly is the Issue..
 
I agree with that actually as well. However the formatting page looks to have no images showing and doesnt mention it either. https://sopython.com/wiki/An_Illustrated_Guide_To_Formatting_Code_In_Chat
Really not a huge deal just something I noticed.
 
1:47 PM
@Anarach did you check that planets contains what you think it contains?
 
@ZackTarr You can edit it and highlight the multi-line editing pain.
 
@AndrasDeak It has the ''pl_pnum'' column
 
@ZackTarr read the title: formatting code in chat
generic formatting suggestions are out of the scope of that page
Chat formatting is a fickle thing, but even if we were to collect every minute detail, nobody would actually read it. It's something you get the hang of eventually.
 
ah, my bad
 
@AndrasDeak I agree with that one being out of scope too haha but there is not a page that mentions how to format chat. Like I dont really know italics, bold, and so on. So I was looking for a page for it. But there probably is one out there just not on our rules page Im guessing.
And yes you are correct, no one would likely read it. But it would be a handy guide to have I feel.
 
1:50 PM
@AndrasDeak I swapped the columns but no matter what I do it is not able to interpret the column
 
@ZackTarr faq and help in bottom right of desktop view
 
Mind blow. Thank you!
 
@Anarach does it work if you explicitly pass x=planets.pl_pnum and similarly for y (and of course ignore the data kwarg)
 
@AndrasDeak Hmmm Interesting..
AttributeError: 'DataFrame' object has no attribute 'pl_pnum'
 
there you go
so find out why you lied to me :P
 
1:54 PM
But I dont understand
Its there
 
it clearly isn't
print(planets.columns) etc
 
I mean , I can "SEE" it.
 
you need to check your eyes or your assumptions
Either you're wrong or the interpreter is. Sooo.....
instead of denial just figure out what you're missing
 
that's an excel table, I'll ignore that
 
1:56 PM
Why?
its a csv file
 
because it's not python and I hate excel and we were talking about a dataframe
why do you insist on not checking your yamming dataframe?
 
I am complete Noob.. PLease forgive me Kind LORD
but this is the file I am feeding it
 
is that a kind of file?
 
1:58 PM
You're asking for help and completely ignoring my help. These are the markings of a help vampire, which also explains why I'm getting annoyed. If you want to get help, start to listen to the people you ask help from.
 
My Bad :-(
 
Yes. But it's never late to improve, but this is something you have to do.
 

« first day (2671 days earlier)      last day (2295 days later) »