Python

Room rules: sopython.com/chatroom Code formatting guide: tinyu...
Dec 16, 2021 16:26
is also allowed
Dec 16, 2021 16:26
[a, b] = [1, 2]
Dec 16, 2021 16:26
I forgot that
Dec 16, 2021 16:20
@Kevin Ah yes, spaces. I forgot, thanks for the link.
Dec 16, 2021 16:19
what is the correct markdown syntax to write code in chat? I forgot.
Dec 16, 2021 16:19
```python
(a, b) = [1, 2]
```
Dec 16, 2021 16:18
with a = () it,s a tuple, but the left hand side of (a, b) = [1, 2] looks like a tuple, but does any object of type tuple get created? I believe not.
Dec 16, 2021 16:17
I think they call it sequence unpacking in the Python tutorial.
Dec 16, 2021 16:16
Is it actually a tuple, though? On the left hand side?
Dec 16, 2021 16:16
or with some actual function: () = g(), where g is a generator, to make sure it's empty.
Dec 16, 2021 16:14
I find it interesting that this is valid Python syntax: () = () (but I don't know the chat-compatible markdown to write it as code here)
Nov 25, 2020 13:57
@cs95 It didn't happen.
Jan 24, 2020 12:42
I propose that, to be more animal friendly, we replace the metasyntactic variables "spam" and "eggs" by "tofu" and "quinoa", respectively.
Oct 31, 2019 13:30
Nov 1, 2017 17:18
@WayneWerner Who reads the introduction to the library reference anyway?
Nov 1, 2017 13:10
@WayneWerner That bit is still in today docs.python.org/3/library/intro.html
Oct 31, 2017 21:41
I don't know about properties.
Oct 31, 2017 21:41
If you make sure you don't store any state in 'self' you can do it, but most objects do have state.
Oct 31, 2017 21:40
@wim I tried to use it on methods, but 'self' is usually mutable, and using it with mutable arguments is a recipe for trouble
Oct 31, 2017 21:40
@wim Be very careful about that.
Oct 31, 2017 21:13
"The keys of dictionaries are no longer restricted to strings"
Oct 31, 2017 21:06
History (Python 1.2 Tutorial): ir.cwi.nl/pub/5009/05009D.pdf
5
Jul 18, 2017 16:35
The only illegal symbol in an identifier I've ever wanted to use is βˆ‚
Jul 18, 2017 16:32
Until Unicode accepts the combining heart above proposal, it will fail.
Jul 18, 2017 16:26
https://chat.stackoverflow.com/transcript/message/38189434#38189434
Thank you kind stranger, the upvote should prevent the question from being deleted as abandoned :)
Jul 18, 2017 14:23
Quite puzzled that this Python bug has been around for 3 years, been reported since 6 months, makes warnings very cumbersome to use, yet nobody but me appears interested :-/ (SO question on workaround got me a tumbleweed)
 

Sandbox

Where you can play with regular chat features (except flagging...
Oct 31, 2019 08:38
This is cruel.
 
Apr 16, 2019 00:27
@SukumarRdjf Please don't ever use this "trick".
 
Jul 21, 2016 16:12
Are there any guidelines on when documentation is β€œtoo specific”? For example, my proposed example was rejected: stackoverflow.com/documentation/proposed/changes/…
 
Jun 29, 2015 14:22
🌈🌈🌈
Jun 29, 2015 14:12
Google also celebrates stuff.
Jun 29, 2015 14:11
🌈 🌈 🌈!