« first day (4018 days earlier)      last day (913 days later) » 

12:05 AM
So
`inspect.signature(some_function).parameters.keys()`
Is there any guarantee that `keys()` will be a list in order of appearance of the function signature?
 
> parameters

An ordered mapping of parameters’ names to the corresponding Parameter objects. Parameters appear in strict definition order, including keyword-only parameters.
written, you know, in the docs docs.python.org/3/library/…
 
What's it doing there?! Why didn't they put it somewhere where people will actually see it?
 
Changed in version 3.7: Python only explicitly guaranteed that it preserved the declaration order of keyword-only parameters as of version 3.7, although in practice this order had always been preserved in Python 3.
 
12:18 AM
and 3.10 finally got a switch statement! Only took 30 years.
 
but its called match
 
i know, I liked the variable name and they are taking it away from me
good thing i haven't upgraded yet
 
I still won't forgive them for what they did to conditionals (auto foo = condition ? A : B)
Does python let you switch on strings?
 
@Mikhail it lets you switch even on parts of anything
 
Is there a cleaner or more Pythonic way to do this? pastebin.com/jvwWWiLN Trying to create enum tuples which I can then access by name using dot notation. It just seems messy =o/
 
12:25 AM
because it's not a switch, it's a match
 
I wrote a script that generates type checking stubs from a pybind11 module, all without knowing regex. Ya'll proud of me?
somehow switching on a string requires taking a hash which might be a secret O(N), where N is the content of the string... And without a hash you need to compare to every string which is like O(N*M) where M is the number of cases...
although the walrus operator is a pretty cool name
 
@Mikhail just to be clear, did you use regex for the task?
ew, realpython
 
I didn't read the link, just kinda posted it as a reference
 
Can you explain (auto foo = condition ? A : B)
 
@AndrasDeak only first the first match group :-)
 
12:30 AM
posting a link you yourself didn't read is signature 2021
 
I've never seen that
 
@SurpriseDog its C++
 
@SurpriseDog foo = A if condition else B
 
Eeek
 
12:32 AM
it was specifically designed that way to creep out Cody
 
if (condition)  { foo = A; }
else            { foo = B; }
 
if (condition)    {
    foo = A       ;}
else              {
    foo = B       ;}
in this case we don't even need the braces, and we could add 300 spaces before the semicolons to push them out of the screen
 
Yes
Or, we could use a simple, elegant conditional operator! :-)
Which allows us to declare the foo variable as a constant, something we cannot do when we have separate if-else assignment.
 
just type it in uppercase
 
How does that help... anything?
 
12:37 AM
FOO = condition ? A : B
now you'll remember not to modify FOO
(It's a joke because in Python it's pretty much impossible to prevent people from rebinding names, so "constants" are basically "consider using an all-caps name and don't touch it")
 
Lame.
 
good thing I don't aim to please
 
 
7 hours later…
8:11 AM
I am confused by gitter. If you go to scipy's gitter page for example there is nothing since september. Is there another place scipy is discussed these days?
 
8:48 AM
Judging by the last few comments by mdhaber, gitter at least isn't the place for user support.
 
9:04 AM
hey list[Any] is a valid syntax right?
def dummy() -> list[Any] should be valid
but my python says type object is not subscriptable
python 3.8
 
@WalidSiddik Only since 3.9
Technically, it's still valid syntax but a type error before.
 
9:43 AM
I'm getting error while trying installing lxml bpa.st/FZFQ
i think it's due to no wheels for lxml within python 10
 
Building without Cython. Try install Cython in the env first? I'm not saying it isn't a python 3.10 issue
 
@roganjosh i tried that and got same error
 
Boo. Then I'm out, sorry
 
It's failing because it's missing a header file. There's a dependency you don't have installed.
That wouldn't be a problem for a wheel install, since these don't need compiling.
 
9:55 AM
The header should be bundled with the installation, though? I actually installed lxml in 3.9 yesterday as it happens, in a clean env
 
am using Python 3.10.0
 
The lxml docs have a reference how to get the dependencies.
@roganjosh It's a header from a supporting library, not lxml itself.
 
10:09 AM
@αԋɱҽԃαмєяιcαη python 10! What is it like in the distant future? Do we still use non-bendable smartphones?
 
Please let there be jetpacks!
 
@AndrasDeak you meant it's not recommendable to use it ?
 
No, I meant that python 10 will probably be released in 2050
 
At least there's a roadmap. My (Android) phone gives me "relevant" links whenever I open a new tab, and one was a news story about how the GIL was going to go away, but I didn't get to read the article. You heard it here first, all
I'm all about the headlines. The content is just detail
 
10:25 AM
I'm all about that base GILectomy
 
bass*
 
11:30 AM
Whoops, right. I actually know that.
 
That's all I came here to say. Carry on. :-p
 
How hard was it not to just edit my message? :P
 
Easy. That'd prevent me from correcting you!
 
Figures
 
12:37 PM
@MisterMiyagi not keen on jetpacks.... hoverboards would be awesome though...
 
12:53 PM
One of those things is not like the other :P
 
Do you mean the non-blue user in the middle?
 
Makes for a nice pattern, though.
 
1:10 PM
kinda feel obliged to say something now...
 
 
2 hours later…
3:27 PM
@PM2Ring youtube.com/watch?v=MZaJUfgCLww was the song I was trying to think of the other night
 
3:45 PM
Can anyone with a numpy+Windows test the MRE on this numpy question? I cannot reproduce the issue on my Mac but some of the external links suggest the OP is on Windows.
 
3:56 PM
Not booted into Windows at the moment to test it, but:
I don't know if it applies to this issue or not, but there is a close association between pickle and np.save. save is the pickle tool for numpy arrays, and if an array contains objects ('O' dtype), it uses pickle to write those. So you could easily end up with several levels of 'save/pickle'. — hpaulj yesterday
definitely rings bells...
 
@MisterMiyagi if it's windows only then there might be implicit 32-bit ints involved
Structured dtypes are always weird for me FWIW
 
4:37 PM
@Andras unless it's some embedded thing... do 32 bit systems exist anymore?
(well - I'm sure you could you really, really, really wanted to but it'd be like trying to buy a non-flat TV these days)
 
4:52 PM
@JonClements numpy ints are C longs which are 32-bit on (even 64-bit) windows
Kevin has 32bit python
 
umm.. thought if they extended enough they'd end up being long longs... but never tried
 
5:05 PM
anyway - foodie times!
 
just checked in to see how the fast api emoji removal process was going, the first thing that caught me eye is that the recent commit messages also have emojis :/
 
5:20 PM
@python_user that's only seen by library devs so it's fine
And that can be part of automation as wim said
 
didnt know that, missed reading that part of chat
 
 
1 hour later…
6:33 PM
@JonClements No. See my question and the behaviour still stands. That's cost me a lot of time in the past
It's a nightmare with heuristics because the algorithm can't converge and you get thousands of iterations of WTF if you don't know it's going to overflow
 
7:06 PM
@AndrasDeak That was my hunch as well. I did not dare try, lest the 32-bit gazes back into me.
 
@MisterMiyagi I can fire up a Windows laptop if you're still interested in answering? I haven't looked at the question yet
Ah, it's bountied! Maybe I'll fight you for it! :P (loading Windows now)
 
I'll happily concede the bounty to whoever is brave enough to use numpy on Windows!
It's just a super weird behaviour and I'd like to understand it.
 
@MisterMiyagi Sir, I have already won. What about the gladiatorial tournament? You're letting the crowd down
I'll be able to run it in a few mins, just not at the laptop yet. This one is for you, though :)
 
*clears throat* There are no clever moves that can help you now! *waves sword*
 
7:22 PM
(None, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) I don't think I can repro?
This is on Windows 10
 
Yam!
Perhaps it breaks on Vista? :P
 
Hahaha
I think I'm not prepared to change my OS for you for that garbage :P
Their bug report is in relation to numpy 1.16 which is pretty old
 
Oh well. Following the question like a creepy stalker it is, then.
 
7:48 PM
Hi everyone. I have little question regarding extended unpacking. a, [*b] = 1, (2, 3, 4, 5) and a, (*b,) = 1, (2, 3, 4, 5) . In both cases b will be a list. I expected that in second case it will be a tuple. Can you point me to docs where this unpacking syntax documented?
More simple example: [*b] = range(4) and (*b,) = range(4)
b will be a list in both code samples
 
It's here, in particular:
> A list of the remaining items in the iterable is then assigned to the starred target (the list can be empty).
 
Thanks, @Aran-Fey
 
And you can see in the grammar spec above that [*b] and (*b,) are just two different ways of creating a target_list
 
It's a bit misleading that both syntax allowed, but result will always be list
Yes, I see now
Still think that it's not so explicit
Thanks again, @Aran-Fey
 
8:06 PM
@OlvinRoght Consider that even if (*b,) denotes a tuple, then b is the content of the tuple, not the tuple itself.
Compare a, (b,) = (1, (2,)), where b ends up an integer.
 
haha, just found this old thing lying around on my hard drive
 
I love happy endings :')
 

« first day (4018 days earlier)      last day (913 days later) »