« first day (3532 days earlier)      last day (1407 days later) » 

1:07 AM
what are peoples' opinion on having the type in the name of a variable e.g. occupation_dict, occupation_list etc
 
@jigglypuff I've only used Systems Hungarian notation once. I know some VB/C# developers that like Apps Hungarian
 
1:32 AM
@jigglypuff Generally try not to, but sometimes is unavoidable. It's usually (not always) possible to avoid it, by using stuff like list comprehensions, lambdas, with-clauses etc. Now that dicts remember insertion-order, even less necessary. If you have code where you find it necessary, post a snippet for us to give more specific advice. Also, if it's pandas or numpy, they have their own considerations and tricks.
 
@smci I'm actually trying to give this advice to a colleague, but want to know what other python people think about it
I always avoid it, and try to make the type irrelevant or implicit by how the variable is used
my colleague has variables names that end in _list_dict ...
 
1:59 AM
@jigglypuff Yes, it's generally avoidable, once new coders know enough Python to recognize an objects's type by how it's being used. (and the only non-trivial cases where it might be necessary would involve performance and big-O scalability, which again beginners mightn't care about)
@jigglypuff Oh God... well most of us started there at one time...
 
haha yes we all started there
 
2:26 AM
where does pip read packages from?
Is there a global repo somewhere
 
@qaispak like PyPI?
 
oh okay, is that where pip installs from?
like when I do pip install flask, it checks there?
 
Yeah that's what it does, for example here's Flask
 
cool, can I change that?
have my own private repo?
 
IDK if conda or anything else have their own ones.
 
2:32 AM
oh okay. Brings me to another question. If I have a bunch of stuff on my requirements.txt and the user runs an install, by default it's going to go to PyPI
so is there a way I could define that in requirements? Like this one better get installed from this location etc
 
needs clarity/ illegible formatting stackoverflow.com/questions/62420405/…
 
@jigglypuff Generally I dislike this idea. And if you want to leave type hints, do so when declaring the variable.
 
If you setup your own index then you can configure pip to install from there.
I don't know about setting that in a requirements file tho.
 
Hmmm okay, because I'm like checking out someone's requirements file and I don't find some of the packages on PyPI so I think they're getting it from somewhere else. Anyway, thanks!
 
2:47 AM
@qaispak I think you would describe that in the README under an 'Installation' heading. e.g. I describe how to set up pip for our internal repos at work in the README.
 
@jigglypuff that makes sense. So it's not something requirements.txt would control? Furthermore, requirements does not have the ability to define diff sources for diff packages in the same file?
 
requirements.txt is typically the output of pip freeze, it's not edited by hand. You then do pip install -r requirements.txt.
so no
 
cool, thanks!
BTW, pip gives an error " X pakage has requirement Y 0.10, but you'll have Y 0.9 which is incompatible"
which I think I understand
but then I see both X and Y installed? Don't get this. Didn't it just say they wont be compatible.
 
perhaps pip can't install different versions of the same package? I'm not sure. Try uninstalling Y and then install X again.
 
No I mean pip does install them. Even though it complains.
anyway, just didn't know if this is a common thing I misunderstood. Gonna look into it.
 
2:56 AM
hmm dunno, never seen that message myself
 
user13682510
3:34 AM
@ChrisP yep
 
user13682510
3:47 AM
Why is my profile always seen by someone recently?
 
Heresies. A not-really O(N) Java-type solution in Python to "count the total number of punctuation characters exists in a string". Not a list comprehension, uses the yukky for i in range (0, len (str)):, the even worse if str[i] in ('!', "," ,"\'" ,";" ,"\"", ".", "-" ,"?"): and an explicit count = count + 1; instead of just summing booleans inside a list-comprehension.
Instead of just def punct_count(s): return sum(c in "!,';\".-?" for c in s)
 
 
1 hour later…
5:10 AM
@roganjosh Now now, let's not get hasty
I have been adding more canonicals. They just haven't been anything worth writing home about (so I don't update the git readme)
@roganjosh not 3 days after that comment I posted about a cool new 1.1 feature on this question
@smci *hiatus from stackoverflow
 
@jigglypuff Avoid it when possible. The name of a variable should describe what the variable represents, not what it is. To specify the type, use an annotation.
For any non-trivial type, hungarian notation is inadequate anyways. An occupation_dict you say? What's the type of the key and value? An occupation_dict_kperson_vjob suddenly isn't all that telling anymore.
@smci I'm missing the context here, it seems.
 
5:37 AM
@smci but not really, I'm around, haven't you seen me answering questions?? I don't post here because the room is usually dead when I'm active
I'm usually only an @ away :)
 
 
1 hour later…
wim
7:07 AM
RO's and mods: I'm airing grievances in metapython. I mention it here because there is only one person currently in the room (me) and I didn't want it to get missed.
 
Anyone know how I can make a cross-platform (between macOS and Linux) distutils setup script that uses OpenMP? macOS uses extra_compile_args=['-Xpreprocessor', '-fopenmp'], extra_link_args=['-lomp'] while Linux uses extra_compile_args=['-fopenmp'], extra_link_args=['-lgomp']. How can I choose one or the other depending on the current OS?
 
@MisterMiyagi in response to your 'Literal'. The 'Literal Democrats' was an intentional name-confusion for 'Liberal Democrats' in 1990s UK election dirty tactics. It became somewhat famous.
@cs95 Ok, welcome back. No I hardly saw you around.
 
@smci Okay. I was talking about typing, not politics, thus my confusion.
 
@MisterMiyagi Yes I knew you were only talking about typing. I just found it an amusing anecdote about the (ab)use of the word 'Literal'.
 
@user76284 use platform.system to find out which system you are on.
 
8:02 AM
@MisterMiyagi Thanks. Fortunately it looks like I can just set os.environ['CC'] = 'gcc-9' at the beginning to force it to use GCC rather than Clang in the mac case.
I do wish mac didn't set gcc to point to clang, though, only cc.
 
8:20 AM
@N.Craig In general with spaCy, you don't need to manually process stopwords, because the stages in the pipeline already implement that, most noteably Tokenizer. See the spaCy 101.
And when you say " for tokenized text that is located in a dataframe", do you mean it came in already tokenized from some other toolkit/pipeline (if so which? nltk? PyTorch? or which?).This could be suboptimal, one common approach is just to re-concatenate the input (with spaces) and start again using spacy tokenizer etc.
 
@MisterMiyagi closed. Irreproducible Thursday is here...
@N.Craig Please first skim through the spaCy 101 tutorial and also find some good code examples to follow and learn from, since spaCy is very powerful but the doc is seriously skimpy, also the code is getting new features very often. (I've just spent the last 48hrs up to my eyeballs in spaCy doc and code and Kaggle. Really the only way you'll learn is by looking at actual working code, plus a combination of SO, spacy doc, blogs, Kaggle forums, Google etc.)
You should follow some decent quickstart/ tutorial pref. using spacy code in your chosen application area (sentiment classification, summarization, search indexing, etc.)
@AndrasDeak INCLUSIVE ROOM has many anagrams, including UNCIVIL MOROSE, NOVICE SILO, RUM, MINOR SOUL VICE, VICIOUS EL NORM. The second one seems quite apt.
@JonClements I'm currently learning it. spacy is impressive, super-powerful, and constantly adding new features (and pruning), but requires lots of experimenting once you get beyond the limits of the fairly basic doc.
@N.Craig actually it might be even better to find a tutorial that covers both nltk and spacy, since a ton of existing code(/blogs) out there hardcodes in nltk assumptions about the pipeline without explicitly acknowledging it. So best to learn both paradigms so you know how typical pipelines implement stuff.
@PaulMcG Surely 'reschedule to a different timezone...'
 
8:48 AM
@wim noted
@joshua "last seen" means "seen by the chat server"
 
9:10 AM
Why the heck is there an abstract class for callables in collections.abc?! Typing is making the stdlib messier than ever
 
@Aran-Fey why not? As a mixin?
 
Who has ever made a callable collection?
 
@Aran-Fey I'm sure someone has :P
 
@Aran-Fey that one dates back to python 2
 
To support MATLAB indexing perhaps
 
9:23 AM
@MisterMiyagi wow
 
The first three pages of github.com/search?q=collections.abc.callable&type=Code contains only lib2to3 copies and other compat things
The one hit at github.com/jonoulton/energyUsageApplication/blob/… (from a venv...) is probably misuse instead of typing.Callable
 
9:42 AM
truly a worthwhile addition
Today I need to read up on co- vs. contra- vs. invariance in order to implement is_instance(some_func, Callable[[T, T], T]) functionality. Send help please.
 
@Aran-Fey I thought you Python folks touted duck typing as the freedom from ever having to worry about types. Covariance and contravariance are things that us statically-typed language users think about.
 
It's a long story... one day I was so fed up with pickle that I decided to implement my own, safe, serializer for arbitrary python objects... and thus my need to validate type annotations at runtime was born
 
@CodyGray or differential geometrists
@Aran-Fey Ahab-Fey
 
Yeah, that seems like a very lofty goal. YAGNI.
 
9:52 AM
@AndrasDeak who?
 
Gee, it sure doesn't sound like he's a nice person
 
Beside my point though :D
Unless you keep at it for 10 more years...
 
Moby Dick is so overrated. It's a lousy novel, and one of Melville's worst pieces, in my opinion.
 
Never sounded good to me to be honest...and I've never read it.
 
10:01 AM
@AndrasDeak that is... entirely possible, unfortunately :D
 
@Aran-Fey I'm gone for an hour or so, but feel free to shoot me some questions later on
once you get past the wording, the stuff makes surprisingly sense
 
@MisterMiyagi typing Stockholm syndrome...
 
10:25 AM
@MisterMiyagi Thanks, digesting variance and the way typevars work at the same time is a bit much for me
 
10:45 AM
this one has probably the largest number of valid close reasons I've ever seen: seeking recommendation, community-specific/offtopic, subjective, Needs details/clarity, Needs more focus, Opinion-based. Oh and probably belongs on DataScience.SE anyway, if all that is fixed. stackoverflow.com/questions/62426896/…
 
I have a question.
Most of you (@Aran-Fey @AndrasDeak @MisterMiyagi @CodyGray ) in this room helped me out with the questions I had about these repositories bitbucket , github. Is this kind of work involving image processing, and writing a converter that interprets a binary file typical for an intern? Or is it above the pay grade of an intern?
 
I wouldn't know, but pinging people like that unnecessarily is not very nice
 
@AndrasDeak How so? Isn't the point of pinging someone to let them know your message is intended for them?
 
My ivory-tower notion is that interns need more specific problems and a lot more help, but within these parameters a lot of tasks can apply
 
@MyWrathAcademia It is, but why are you asking specifically us 4? There's a whole chat room full of people here
 
10:51 AM
@MyWrathAcademia it is, but the way you phrased it didn't make it obvious if you were specifically asking us
 
@MyWrathAcademia I don't understand your question: does "interprets a binary file" merely mean "write code that parts a binary image file format" or "design, train, debug and crossvalidate an ML-based image classifier"?
 
@smci there's a few week's context here
 
IMO only an optimist would let an intern touch binary data, but I'm not a professional
 
Specifically the problem they've been struggling with
@Aran-Fey perhaps they think it builds character :P
 
@AndrasDeak Ok, is there a one-line summary? Is this a image-file-parser question or an ML question or something else? Is this a toy project, intern summer project, research project, production...?
 
10:52 AM
@Aran-Fey I guess I could be less explicit, I just wanted to make sure that those the message is intended for don't miss the message. For example, they could be away getting a cup of coffee :)
 
What is the consequence of not completing the task, as an intern?
 
Porting code from a language they don't know is probably not the ideal task
@smci porting a reverse engineered binary file parser. See the linked repos
 
@smci No machine learning involved here (thank god!). I mean reading a binary file as bytes and converting them to the data types described in this wiki.
 
The notion of "above my pay grade" seems... odd to me, considering that you are getting exposure to, presumably, a real-life issue. Whatever you pick up along the way are just extra strings to your bow. I've seen some interns in the past that file paperwork, so it could be worse
 
"Involving image processing" is a very optimistic frame for the problem :)
 
10:56 AM
@smci If you open the binary file in a text editor like vim it does not make sense so the only way to understand information stored in the binary file is to interpret/convert it according to the structure described here
 
Real pros edit hexdumps
 
@MyWrathAcademia Uhuh. If there's several weeks' context to your question, can you please summarize the story so far in a couple of paragraphs? Otherwise the rest of us won't be able to follow any of this. What is the intern student studying, and what is their level? Is this a toy project, intern summer project, research project, production...? What is the specific problem right now? Have they started working on it already, or are you polling opinions on whether this project would be suitable? etc etc.
 
They're asking "is my struggle normal for an intern?"
 
@smci It is a project for an intern. It's similar to what this Python program and this C++ program do except with more features where specific data in the binary file is modified.
 
The last session involved weird bit reversal manipulations
 
11:02 AM
@roganjosh There is no problem regarding whether the task can be completed or not. It's just that I believe the difficulty of the task is being severely underestimated, whether intentionally or not.
 
Or the expectations regarding the intern are underestimated ;)
 
@AndrasDeak Yeah the task is not in Python or C++.
@AndrasDeak The next task that follows is exactly that actually, I kid you not.
 
Doesn't sound shocking to me
You can't expect to write hello world
Question is if you're given the help you need (if you ask)
I don't think an intern is expected to be very autonomous
 
@AndrasDeak No one else deals with binary stuff like this. The rest are developers who just work on web stuff, APIS, UIs etc. The intern is expected to not get much help from within the team.
 
that is probably a problem
"Intern as in cheap labour" rather than "intern as in future dev"
But I'm in academia so I can only muse
 
11:09 AM
@roganjosh I understand, but what if you're getting paid the same as interns who file paper work when your actually doing a Research and Development project like this?
 
@MyWrathAcademia: IMO the advice you got back on May 28 should have convinced you to not do this. Why on earth do code archaeology on an unsupported image file format, trying to discern the intent of the original coder, which will be slow and error-prone. MisterMiyagi was spot-on:
May 28 at 13:40, by MisterMiyagi
@MyWrathAcademia Then why are you trying to use it? Relying on unmaintained data formats is even more technical debt than relying on unmaintained libraries.
If I was the intern I'd run away from your company screaming and tell all the other students never to go there. Honest. There must be lots of other interesting useful problems your company has you could giv them to work on.
"Extend dead unsupported image file format long-ago abandoned by maintainers" doesn't sound appetizing.
 
@smci Intern student is not from a computer science background, it is a research and development project, and a project to be used in production (so it is adding value). The specific problem is to write a binary file converter which parses the binary file into a readable format, anonymize that binary file, extract image data from the binary file, and convert the image data to an exportable file format. The intern has started working on it already. Do you need any more information?
 
So not from a computer science background and being tasked with that? I'm feeling for this intern :)
 
@AndrasDeak You're in academia? Great. I miss only having to meet my super visor at most once or twice a week for an update when doing research and development, instead of doing research and development and giving updates every day, even when research can take time.
 
@MyWrathAcademia There are tons of live supported image formats, you should use one of them instead, that would add value. As MisterMiyagi pointed out to you, worsening and prolonging technical debt does not in fact add value. And I don't know that this would even count as R&D, it's just production devpt. What do you expect the intern would actually learn that would be valuable to them in their discipline? Just pick a live image format, already.
 
11:20 AM
Also - unless I was doing something completely wrong when I was responsible for interns, don't you get 'em to help write/change little bits after you've given 'em a bit of the overall picture so they actually understand and learn something rather than throwing 'em in the deep end for what appears to be a (forgive me for saying) silly project?
 
@JonClements The intern does come from a hard engineering background so is not afraid of solving problems, the intern has seen more difficult problems from their academic background.
 
@smci I suspect there's proprietary tech and the format is a given
 
@AndrasDeak Ah right. Shouldn't say "R&D" when mean "proprietary product devpt". But maybe the school doesn't care much what the interns get used for.
 
Meh
 
@smci Can you give an example of a live supported image?
 
11:23 AM
You can still do R&D down the line
But I agree the circumstances don't sound good
 
@smci Also it's not up to the company to pick a file or image format. The company works on whatever the client gives.
 
@MyWrathAcademia How many different image formats are there? that have supported packages? Tons. Switch to a supported one, unless as Andras says you're forced to stick with this one for legal reasons.
 
@MyWrathAcademia sure... and I'd like to think I'm not a bad problem solver in general and especially in the tech world... but I wouldn't expect my internship should I choose to go into medicine or something to be given a scalpel, pointed to a patient and told "they're not well - off you go!" :p
 
@MyWrathAcademia Oh come on. Are you farming out a non-CS intern for contract devpt to end-customer? (I had a friend whose academic supervisor was infamous for doing that, and making himself money from the minions' "R&D" contracts, and all to the detriment of them doing real "R&D". Nobody within 500+ miles wanted to work for that supervisor.)
 
@JonClements I see, good analogy. I guess it is sink or swim.
 
11:28 AM
there should be no sinking - either for the intern or the patient... there should be learning and eventually swimming... either wise, it's pure idiocy
 
@MyWrathAcademia or just low-risk gamble, see chat.stackoverflow.com/transcript/message/49669890#49669890
 
@smci I just had an epiphany, thanks.
@AndrasDeak I hope that is not the case.
The problem to be honest is not really the work itself, it is that the intern is doing work that other much better paid developers in the team would struggle with, and yet attempts to convince the employer that the interns work deserves a higher pay is met with resistance and excuses as to why the intern should not be rewarded with more $$$.
 
@MyWrathAcademia Err, even if we set aside all the other stuff, that's multiple commercial and management (and ethical) questions, but not programming questions. And is your motivation for wanting to have the intern paid more to make sure they don't quit before the port is done?
 
@AndrasDeak The intern should probably ask to work on the code base like @JonClements says here:
16 mins ago, by Jon Clements
Also - unless I was doing something completely wrong when I was responsible for interns, don't you get 'em to help write/change little bits after you've given 'em a bit of the overall picture so they actually understand and learn something rather than throwing 'em in the deep end for what appears to be a (forgive me for saying) silly project?
 
An unrelated question about porting: should this one be ? It seems to be someone wanting to convert a timeseries SQL query on some stock dataset from their R history file(?) into valid Python. stackoverflow.com/questions/62427900/rhistory-to-python
 
11:39 AM
@MyWrathAcademia sounds like such an oppressive/toxic environment they don't feel it's an option or are afraid to ask for that... (not that they should having to be asking for that at all - it should be a given)
 
@smci Yes the process is error-prone and slow which is why the intern has to do a lot of debugging, and research. Another problem is that even though the process is slow the intern is expected to give meaningful updates every day during the scrum which I don't think is good as the intern feels a lot of pressure to have an update for the scrum or make up bullshit in order to "fake it to make it".
@smci The intern will not quit. My motivation for wanting to have the intern paid more is that living costs are high, and it is not right for an intern to be doing quite complicated work and for the employer to take his work and effort for granted.
 
@MattDMo Hmm, similar to the stock query one I posted above ^^.
 
@MattDMo "needs debugging details" (née no MCVE)
 
@AndrasDeak well, yes, that's what I meant.
 
11:50 AM
@Aran-Fey I guess that tackling both at the same time is a bit much. FWIW, I usually just need TypeVars these days. If it makes it easier, you may want to start just with them and approach co/contra-variance later on.
 
@MattDMo I didn't see that kind of vote yet on the question :)
 
Though variance IMO is the simpler topic, there are just unexpected cases where it hits you unexpectedly.
 
Unclear applies too of course, just less specific
 
@AndrasDeak I really thought that's what I voted. Sorry, it's early and I'm a little frazzled...
 
@MattDMo no worries, I just didn't know if you got lost with the whole close reason renaming
 
12:04 PM
Well, I just mistook "Homebrew" for "Hebrew", so it's definitely lack of sleep
 
Heh
 
12:17 PM
@MattDMo That would be epic. Like the time I confused Masada with 'masala'.
 
 
1 hour later…
1:20 PM
@Aran-Fey What are you using to read up on the typing stuff? I've just crawled through Wikipedia on Co/Contravariance and it feels like they really beat around around the bush. PEP 483 is somewhat better, but mainly because they have examples.
The Callable examples get the closest, but still feel a bit unclear.
 
I've got the thing Cody linked and PEP483 open, but haven't made much progress. I'm still shuffling things around to make my code work with TypeVars at all
I'm probably gonna start by making it work without the variance stuff first, like you suggested
 
Eli's blog is great, not just for that topic! I just always have to mentally replace <: with issubclass...
 
I asked this last night but seeing as new people are here...
pip complains about my dependency and goes ahead and installs them both anyway. What's that all about?
 
@qaispak please don't ask for help here with fresh questions on the main site as per sopython.com/chatroom
 
my bad
 
2:00 PM
Cbg
I am running my flask server with python3 conf_server.py and everything works great
Now I want to not run it with the dev server so I try to run it with: gunicorn -w 4 -b 127.0.0.1:5000 conf_server:app but this just hangs, without any errors or warnings. Any ideas what I can do to debug it?
Ok, I got further now I get: gunicorn: error: unrecognized arguments: -b 0.0.0.0:5000 conf_server:app
looks like configargparser and gunicorn don't like each other
 
Why does mypy complain about this? Surely there's no problem if T takes the value bool?
T = TypeVar('T')

def t_t__t(x: T, y: T) -> T:
    return x

def func(x: Callable[[int, int], bool]):
    return x

func(t_t__t)
mypy output: error: Argument 1 to "func" has incompatible type "Callable[[T, T], T]"; expected "Callable[[int, int], bool]"
(Oddly, it doesn't complain about t_t__t's incorrect return type if I remove the return x)
 
2:19 PM
lol adding -w -b and conf_server to the configarparser arguments let's me run it. Well so be it
 
Well, apparently it's not a TypeVar thing, because replacing T with bool gives the same error...
 
If you have a TypeVar, all uses of it have to be filled in with the same type.
 
Isn't t_t__t taking 2 args of a type, and then returning a value of the same type?
Your x Callable is taking ints but returning bool
 
Think of it as a textual replacement. You could replace T = bool or T = int but not both.
 
But bool is a subclass of int, so where's the problem?
 
2:21 PM
cough variance cough
 
Oh. :I
 
I also guess that typing does not treat bool as an int, but cannot say for sure.
 
@PaulMcG As far as I know, the return type can be different. Let me just find the relevant docs...
 
ah, that works actually.
 
Actually, I may have misunderstood. I was referring to this:
> The latter example’s signature is essentially the overloading of (str, str) -> str and (bytes, bytes) -> bytes. Also note that if the arguments are instances of some subclass of str, the return type is still plain str.
 
2:24 PM
those are with AnyStr, no?
 
No, A = TypeVar('A', str, bytes)
Might be equivalent to AnyStr, idk
 
Ah. If you add some types or bound= to TypeVar, you restrict which types can replace it. E.g. A can be either str or bytes. It will still only be one of them at once.
You need separate TypeVars for each separate argument.
A = TypeVar('A', str, bytes)
B = TypeVar('B', str, bytes)

def foo(a: A, b: B) -> Union[A, B]: ...
 
Right, so all arguments must be instances of int or all arguments must be instances of str. But they don't all have to be of the exact same type, e.g. one might be int and another one bool
 
if you allow for variance, yes.
But that only works for classes, I'm afraid.
 
Whoops, I just realized it was bytes and str, not int and str
Say I have a function defined as def t__t(x: T) -> T:. What kind of TypeVar do I have to use to make this function an instance of Callable[[bool], int]?
 
2:35 PM
None, that works out of the box.
Functions are covariant in the arguments (subclass bool can take the place of int) and contravariant in the return (baseclass int can take the place of bool).
 
*sound of brain exploding*
 
the covariant part is the easy one.
 
Ok, I'll just assume that my code is correct and will update my test cases to match.
 
a subclass can do everything its baseclass can. So you can always "use" a subclass in place of a baseclass. That's like the assignment x: int = True – which is exactly what happens when you pass True as the parameter x: int
 
@Aran-Fey That's the TDD equivalent of "remove the git repo and start from scratch" :P
 
2:39 PM
The cool thing is that I'm only half-joking. I did just write some code that found a few mistakes in my tests. I'm kinda proud
 
\o/
blimey! I've swapped the variances in my comment again. :/
A function is contravariant in the argument, but covariant in the return type.
 
Running all my tests cases through mypy one-by-one is... exhausting. Doesn't mypy have an API of sorts...?
 
usually, you just say mypy my_package and that's it.
 
Yeah, so I have to copy each individual test case into a python script so I can run mypy on it to confirm whether it should pass or fail :I
 
2:55 PM
where are these stored otherwise?
 
Inside a massive pytest.mark.parametrize call
@pytest.mark.parametrize('value, type_, expected', [
    (t__t, Callable[[int], int], True),
    (t__t, Callable[[int], bool], False),
    ...
 
dupe stackoverflow.com/questions/62430381/… (the non-dupe part of postprocessing is trivial)
 
@Aran-Fey Ugh. I feel your pain.
 
I have a problem in this code
It tells me the foloowing error:
inconsistent use of tabs and spaces in indentation
 
that's because your last line is indented with tabs, not spaces
 
3:04 PM
4 spaces?
 
pardon?
 
How many spaces I should add ?
relatively to previous line (if statement)
 
how many spaces did you add in the other lines?
and how many tabs did you add in the other lines?
 
only tabs, one tab of indentation each time
 
that's not what github tells me
all but the last line are indented with spaces, not tabs
 
3:09 PM
does PyPI not maintain release notes?
 
I tried it again, now it works, only with tabs, thanks.
 
@qaispak what do you mean by "maintain release notes"? project metadata on PyPI does not include release notes.
 
3:25 PM
@qaispak Just go to the github repo for the pypi package and view the releases. All release notes should be published there.
 
Thanks @RoadRunner-MSFT , @MisterMiyagi I meant that -- what got updated in each version etc.
 
fellow snakes. cbg to all.
 
3:50 PM
@qaispak - there is no automation or enforcement of release notes or changes notes, it is just a convention.
 
user13682510
4:03 PM
@idjaw sssssssssssbg
 
@PaulMcG current task I'm trying to solve at work. Want something dead simple that leverages good release note writing
 
user13682510
@idjaw uh huh.
 
Depending on the context of the release management, it can be quite the beast. You kind of have to figure out between your delivery and deployment how you need to track all of this and what to include in these notes (also keeping in mind you have to write things out comprehensively).
 
how come firefox lockwise doesn't have a password generator? I don't get how it can miss such a simple feature
 
@AndrasDeak The question seems rather serviceable if one does not know the OP's history. It also does not match the usual dupe suspects.
 
@Hakaishin I might be wrong. But, I think it is disabled by default
Personally, I'd much rather use a third party password manager.
and not having anything attached in my browser
If you're really wanting to get secure, you need to make sure you take the appropriate measures. Off the top of my head, I'm almost sure that the master password is not set properly unless explicitly set. So all your passwords are accessible directly
 
@idjaw no it's on by default, but it doesn't show up when you want to manually generate a password. Welp I reused one from another website
@idjaw that is true and a terrible default. I don't get it how this got trough review
 
all software sucks
everything is broken
 
@idjaw why not? I was using bitwarden for a while, but the autofill was lacking a bit. and the lockwise seems to autofill better and in more places
very true
 
4:34 PM
@Hakaishin ah. to rephrase: not attached as in dependent on just that browser. I use lastpass if that helps illustrate what I was trying to say.
 
yeah I got that, but why do I need more than 1 browser?
 
Because whatever browser you use, you have a consistent form of security that you want to use that is "better" than what is in the browser. A tool that is agnostic to the browser you are using. That's part of the point.
 
how do you know it's "better" maybe lockwise is "better"?
I see it this way, the less different entities I have to trust the better. I already trust firefox anyways. So this reduces my trust attack surface, compared to using yet another entity for something I need
It's the whole centralism/federalism debate, with all it's pros and cons attached
but thinking about it from an optimal control theory way(which I now only the word and have some intuitions about, but no actual knowledge xD ) I assume in a perfect world centralism should be better
 
I need passwords for more than just the web, so...
 
better as in more secure.
And exactly. Passwords for several other things other than in browser items
sure, you can argue "it's good enough". I'm not debating that. In general you will find that typically password managers are preferred.
Above all else. I'm not saying all this to convince you to change what you are doing. :)
You do you.
 
5:36 PM
@PM2Ring :49652340 Just coming back to this. Yup. I changed to root.mainloop(), used a handler that does root.quit() -> that was my biggest issue - I was trying widget.quit or root.destroy in my handler, and wasn't getting right behaviour both when I clicked the window and when I clicked the button. I'll probably implement a cancel button too.
 
6:19 PM
I'm probably the only person to notice the missing comma between T_co and T_contra here
 
^ There's a missing comma between T_co and T_contra in that link. Just noticed it.
 
:I
 
It's been a long day, sorry :P
 
After making my brain think about typing and variance all day, I stared at that for a full minute before realizing "hol' up, that's a mistake". It may be a minor achievement, but it's an achievement nonetheless, and I won't let you take that away from me >:I
 
<Tries to unsee it>
 
6:26 PM
<has no idea what's going on....leaves to make a sandwich instead>
 
@Aran-Fey I always skip to the examples because the double-generic signatures are impossible to read. ^^
 
6:39 PM
I only noticed it because I was looking for a contravariant typevar for my unit tests. Not keen on implementing the code for that.
 
I'm a bit confused about the copyright mentioned here. It's potentially that I sorta skip the gumpf at the top of modules that looks like license stuff (I do pay attention to actual licenses, but from the package root) but it doesn't seem common. Does this mean anything over-and-above the license? I've ripped the general approach for the SQLA interface and made modifications
 
@wim Hello! :) long time
 
It's a bit of an abstract question, I'm just curious of a potential pitfall down the line if you were to opensource a library that became popular... kinda like how music artists can sue other artists that appear to have taken a general theme of the backing track, even if it isn't actually the same thing
 
TIL the class statement does more magic than I thought
>>> class I(List[int]): pass
...
>>> type('I', (List[int],), {})
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: type() doesn't support MRO entry resolution; use types.new_class()
 
6:55 PM
silly preference I have. Hope you understand.
 
wim
sorry! didn't see in time
 
all good :)
 
@Aran-Fey not even sure what that means oO
 
Not sure either, but it's related to the new __mro_entries__ dunder AFAIK
 
wim
PEP 560 has a section about that
@roganjosh I don't think it means anything extra. code is automatically granted copyright protection even if author didn't put a (c) symbol
likely just some crap that the user's editor adds in header automatically (til gumpf)
 
7:17 PM
ugh. That message really only makes sense if you are up-to-date with Python's typing's innards.
I like the productivity boost, but the layers of ugly, fragile hacks is alarming.
 
I have alarmingly many functions that dynamically create classes that now need a rewrite...
 
^ this is exactly my qualms with all of this. It all works well, until it just... doesn't.
Feels like many things are just cherry-picked to fit someone's usecase.
 
So... I have a function that takes a bases tuple and a metaclass (or class_factory, if you prefer) argument. I was planning to be user-friendly and call types.resolve_bases before calling the class_factory, but that function was added in 3.7 and I want 3.5-compatibility... so...
Guess I have to write my own resolve_bases now?
 
seems so :/
 
@wim That was my thought too. Also, I think it's a good word but I might have gone a bit too hard on colloquialisms - I didn't put my formal hat on whilst juggling several others :)
 
8:07 PM
@Aran-Fey man that's a lot of metaprogramming - what are you dynamically creating classes for?
 
For some reason I tend to write a lot of classes that wrap around existing objects, kind of like weakref.proxy. So I need to dynamically create classes that implement the correct dundermethods
my_list = MyWrapper([])
my_list.append('x')
print(len(my_list), my_list)
like ^ that
 
8:44 PM
Having been annoyed by helping people with lots of unnecessary interface replication of delegated objects as I was learning Python myself I have kept well away from this problem altogether. What's keeping you from doing class MyList(list):... instead?
 
community/ needs focus/ needs details/ no MCVE/ seeking recommendations stackoverflow.com/questions/62427900/…
 
Well, I need to wrap around an existing list, not create a new one
 
@smci closed
 
@roganjosh Thx. Do you know a better way of communicating to the OP: "No, 99% of people/(Python users) won't know that by 'timeseries', they really meant 'TSDB-format stock queries'".
 
@smci not in the slightest. I don't know R so that question is gobbledygook to me
 
8:54 PM
@roganjosh It's actually got nothing to do with R (.Rhistory is just the user command log from an R session; it could be any log from any language). It turned out it's about stock queries in TSDB format, which I linked to. "TSDB format" is not specific to Python or R any more than "SQL" or "JPEG" or "GIF" are.
 
@smci I think you were clear enough with this
After that, the OP meanders. I agree with your call to close it
 
@roganjosh: I see you recently updated the sopython cv-pls wiki page, it looks good but we can't see the before-and-after, could you please post a very brief summary and notifier of what you added/removed/edited?
 
@smci "It typically takes five votes" --> "It typically takes three votes"
Jun 12 at 18:14, by roganjosh
Ooo, that needs editing to be in-line with the permanent 3-vote-requirement
That was the only edit
 
9:20 PM
@Aran-Fey You may well see a blog post or article from me saying to avoid doing that... if you're aware of any posts or other arguments in favor of the idea, let me know...
 
@roganjosh Ok, but in future can people please post a one-line notification wth summary of changes when they edit that?
 
I did
I don't have access to the database or the revision history. I posted exactly what the problem was and fixed it.
 
9:58 PM
recbg
 
 
2 hours later…
user13682510
11:55 PM
rbrb
 

« first day (3532 days earlier)      last day (1407 days later) »