« first day (3998 days earlier)      last day (933 days later) » 

2:19 AM
cabbage!
 
 
2 hours later…
3:53 AM
cbg guys
@U12-Forward python has more question than java now :D
 
Yeap
2 days ago, by U12-Forward
The moment has come! is second place now! https://stackoverflow.com/tags
 
ahh I didnt notice that
 
Yeap!
Was monitoring it
 
i like python
 
4:32 AM
me too :)
 
 
2 hours later…
6:04 AM
Not sure if that's a good or bad thing :p
 
6:28 AM
Ah
 
 
3 hours later…
9:21 AM
The more people are interested in a language, the dumber the questions get on the average, since a larger proportion of the community are newcomers. Python's answer has traditionally been community organisation, but I'm not sure how well that scales to Microsoftian user counts.
Another generality: the larger communities get, the smaller becomes the proportion of community members willing to stand up and do things rather than just flap their hands and chatter.
 
10:04 AM
I think python will be the #1 language in all sides one day
The community is going to get it there
 
@holdenweb "dumber" is relative imo
 
These people are talking in python community chatroom and saying python community is dumb
 
is this a micro optimization question? stackoverflow.com/questions/69333576/…
 
@WalidSiddik No, they're saying that there's a higher proportion of dumb questions, not dumb people.
 
yeah I get it
I meant that by talking here, they are part of the community
 
10:19 AM
@python_user pointless navel-gazing
 
thanks, also that is a new word to me, TIL :D
 
Perhaps it would be more diplomatic to say that with a lot of people starting to learn Python as their first coding language that it's only natural that we get more beginner questions.
In the early days of SO, we got a lot of beginner questions too. Nowadays, it's easy to find the answer to most beginner questions by searching. So if someone actually posts a beginner question, either they didn't bother searching, or they don't know how to search for the answer. There's no excuse for not trying to search, but it's perfectly understandable if a beginner doesn't know how to search for their answer, or to ask their question in a clear way.
 
@PM2Ring you're right
new users try to gain reputation by asking questions, that's why they don't bother searching
 
well there are also new users dont care about rep, they just want an answer
 
@WalidSiddik no, it's new users not bothering searching and asking instead
People forgot to learn before using. They want everything now. So they start typing out their first hello world, realise they don't know how to do it, and ask on Stack Overflow instead of reading a tutorial.
 
10:32 AM
@AndrasDeak you are actually right, I see lot of problems that are caused by not-knowing-the-language
 
if people tried to learn the language first then python wouldn't have taken over java
 
A huge proportion of the low-quality questions come from people who haven't studied a proper textbook or tutorial. If you have trouble understanding something in a textbook or course notes, SO may be able to help with that, but it's not a replacement for a textbook.
OTOH, some questions come from people who are trying to figure out stuff about something they've read in their textbook. That's commendable, you should test out the stuff you're studying. The solution to their problem might be in the next chapter or so of the book, but they don't know that.
 
As if like python is getting too popular and less used
No I don't actually mean that
 
A big factor is that a lot of schools & colleges have switched to teaching Python instead of Java as a first language. So we now get more questions from people who are totally new to programming, not just new to Python. And I expect that high school kids are going to be even less motivated to search, and less skilled at writing clear complete questions, than university students
 
It's hard trying to learn another language if python is your first
At least I think so
 
10:44 AM
@PM2Ring completely agree, the influx is in vast amounts;
 
@WalidSiddik As much as I love Python, I'm not convinced that it's an ideal first language. But it's probably better than JavaScript or PHP. We had a conversation about this topic a little while ago.
Jul 22 at 13:36, by PM 2Ring
@AlexandreMarcq I love Python, but I've often worried that it's not necessarily a good choice as a first language. OTOH, JavaScript & PHP are probably worse choices. I don't know Java well enough to have a properly informed opinion, but it seems overly verbose and "fussy" to me, since everything needs to be in a class.
 
I learned python as first
 
Back in the day, Pascal was an excellent 1st language. But it's a bit antiquated these days, since it has no OOP support. It does have OOP descendants, the Modula family, but they don't have general popularity.
 
language-independant progamming and problem solving should be a thing but it sounds self-contradictory
 
@PIngu I think you do need to know (at least) one language before you get into that. Some people can learn this stuff in purely abstract terms, but most of us learn best from seeing and working with actual examples.
When I'm trying to learn some new programming thing I have to write little programs to test it out. Otherwise, it doesn't "click", and I probably won't remember it in the long term.
 
10:57 AM
yeah totally, also natural language to python(beta openAI-GPT3) is picking up, so i guess the situation may soon deteriorate, spinning up a newer cluster of people who program without knowing how to code.
 
Eek!
OTOH, I don't mind the idea of some kind of AI assistance while coding, assuming the coder does actually know how to program ;)
I write a lot of Python on my Android phone. It took a while, but the suggestions I get while typing are now often quite useful. Eg, if I start typing a for loop, enumerate pops up as a suggestion at the appropriate time. Or if I type from itertools then import pops up, followed by the functions I'm most likely to import.
 
the power of the tools rests in the hands of the wielder
 
Of course, it's not quite the same as proper tab completion, but it's pretty impressive for a phone that doesn't even know that it's writing Python. :)
@PIngu "Our latest technological advances allow you to create utter garbage at a faster rate than ever before" :D
 
11:27 AM
what do you all think about no-code programming?
can it be the future?
 
i am begining to wonder, if my this lamenting is a norm. just like i would recommend people to learn c before python rn, a -20 years ago the now-me in the past would have told one to do hex-coding to get fluent with computational program solving and +20 years in the future the now-me would have told one to learn python first to grab the basics.
 
it will have "a" use case. but it wont replace code programming
i think python makes for a fantastic first language.
 
why was python named python?
just wondering
 
@WalidSiddik Well it was because of the Monty Python show
"Monty Python were a British surreal comedy troupe who created the sketch comedy television show Monty Python's Flying Circus, which first aired on the BBC in 1969. Forty-five episodes were made over four series."
 
I googled it and it gave me "Monty Python's Flying Circus"
What does it have to do with python
 
11:35 AM
Guido was a fan of the show.
 
oh I see
 
The name? Everything needs a name in the programming world. Consequently, the cat I got on the same week I started learning Python/programming is called Monty :)
Although I'm not a fan of the show
 
but you are of python right
 
@WalidSiddik we can expect this question in SO in a few years to come(or perhaps already), but it will be trashed in under a minute. Like we discussed
 
The link to an off-beat comedy show certainly had an effect on the language becoming well-known, especially in the early days. And attracted coders who were also Monty Python fans.
 
11:39 AM
@PIngu that's funny
was it a silly question btw
 
@WalidSiddik There is no such thing as "asking dumb questions".
 
I've learned a lot of languages over the years. I still remember some of them. ;) I was writing C for ~20 years before I learned Python. And I learned IBM 360 assembler 6 years before I knew C even existed.
But my first language was a fairly early dialect of Basic. I've probably used more than a dozen different dialects of Basic, sometimes even 2 or 3 dialects on the same day.
 
Wow.
 
@PIngu there really is. Like "how do I write hello world in Python?"
 
@AndrasDeak funny
 
11:45 AM
What is?
 
@AndrasDeak depends on whom i ask and on what platform; in SO now defenitely yes. maybe not when i am newbie and asking my tutor the same in say, a computer lab
also hypotheically speaking on February 21, 1991;
 
@WalidSiddik People get very simple exercises on the level of writing a "hello, world" program when they are starting out. And some of them dump such assignment questions on SO.
 
there should be a dumbquestions.so
since the need is increasing
 
If you have to ask how to write a "hello, world" program, then either your teacher is doing a bad job, or your textbook is rubbish. OTOH, if you've written the "hello, world" program and you can't get it to run & print "hello, world", then sure, you need to get someone to help you.
 
@PIngu it's not February 21, 1991
but whatever
 
11:58 AM
A funny thing is people posting their homework on SO
And in the comment they get a "open letter to students with homework problems"
 
@PIngu Perhaps my words implied a value judgement I did not intend. I meant to point out that if growth in user base is fast enough the average level of language knowledge is bound to go down. I saw this happen with VBScript.
 
import sys; print((264 * 293258727019 * 34172030254961371).to_bytes(13, sys.byteorder).decode())
 
@PM2Ring Haha! That's very crazy!
 
That's ...
How did you do it
oh I get it now
Too clever for a hello world program
 
@PM2Ring Simula was one of the influences on me. After I decided Smalltalk-80 wasn't going to do it for me and before Python existed it was a very usable object oriented language. I believe Modula was also heavily influenced by Simula.
 
When I was an undergraduate at Leeds I met Graham Birtwistle, Simula's inventor, because he was porting Simula to the DECSystem-10. This was back in 1974: Simula was arguably the foundation of all object-oriented languages.
[Memory failure: in fact I learned Simula before SmallTalk, though I reead about Smalltalk before I knew of Simula's existence].
 
@holdenweb I remember hearing about Simula, but I never saw it, even in print. I read a bit about SmallTalk, but never saw it in action. Around the same time, I had some friends who were getting into Prolog, which sounded interesting, but I never got to try it myself.
 
@holdenweb i can totally understand that, reminds me that languages(here english) cannot assure a cent percent efficiency in aiding commuication. also my interpretor is a bit oddly designed too. :)
 
Those old languages had to work with the technology of the times. That imposed some limitations, but it also lead to some pretty compact code. Nowadays, the idea of a compiler or interpreter running in under a megabyte is almost inconceivable. But back then, 1 MB was a lot of RAM, and a lot of money.
 
@WalidSiddik A part of the future, definitely - it already is. I'd argue that the simpler uses of spreadsheets are exactly codeless programming. But I don't ever envisage a codeless operating system. This may just be defining the limits of my imagination ...
 
12:21 PM
hmm
 
By the time I got my 1st Amiga in the late 1980s, the price of RAM had plummeted to $100 / MB. Still, buying 8 MB was more than 10 weeks rent on a two room apartment in a fairly nice district in Sydney.
 
100 per MB
things of past
 
@PIngu Thats how computer science was taught at Manchester when I joined the CS department. The first undergraduate class in programming had students enter a program in either hex or octal, I don't at this distance remember which but I'm fairly sure it was octal. "Heavy engineering tradition" describes that department, though. By some lights Tom Kilburn built the first stored-program digital computer.
 
@holdenweb How long is script going to be a plain text file
 
Not sure why I should be considered an authority on that topic.
 
12:28 PM
I remember people talking about codeless / natural language programming back in the late 70s. That sort of thing is more viable now, but it's still just a dream, IMHO. The problem is that natural language is too fuzzy & ambiguous. Even just trying to communicate algorithms to other humans requires some kind of formal language.
Similarly, mathematical proofs are generally written with a combination of precise natural language and formal symbols. If you write a proof just in symbols, it gets really hard to read, and has a tendency to get bloated. OTOH, if you try to do just using words & no symbols it also gets overly verbose & vague.
Here's an extreme example of symbol bloat:
56
Q: Bourbaki's definition of the number 1

John BaezAccording to a polemical article by Adrian Mathias, Robert Solovay showed that Bourbaki's definition of the number 1, written out using the formalism in the 1970 edition of Théorie des Ensembles, requires 2,409,875,496,393,137,472,149,767,527,877,436,912,979,508,338,752,092,897 $\approx$ 2.4 $\...

 
I don't understand a single line of that
You are a math guy, I am definitely not
@PM2Ring
 
@WalidSiddik I've seen JavaScript using λ as a variable name. I'd hate to work on code like that.
 
You can do that in python too
 
@WalidSiddik That's a pretty heavy article. I don't understand much of it either. But the point is that if you try to define everything in a mathematical proof at the lowest level, and don't combine those low elements, it gets ridiculously large.
 
thanks for that
 
12:38 PM
@WalidSiddik Sure, but we don't like to encourage it. ;)
 
1:05 PM
I get why you don't
"python variable names should be in lower Latin characters"
 
 
4 hours later…
4:45 PM
Disappointment of the day:
>>> reversed(reversed([0, 1, 2]))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'list_reverseiterator' object is not reversible
 
recbg
@Aran-Fey well duh.
there is only one obvious way to do it, if you're dutch.
you should have thought about this before you reverse your sequences.
It looks like you've got yourself an outdated or rather bad Python book that teaches obsolete syntax - that % syntax was replaced by two different methods that are easier to use, first appeared in 2008 and the second in year 2016, which I believe is your book's publication date. I suggest you have a look on the Stack Overflow Python chat room's recommended book list . On the other hand, if the book indeed is "Learn Python In a Weekend, Python for Beginners", then it is explained succinctly just under that fragment. — Antti Haapala 25 secs ago
 
5:31 PM
can someone walk me through how result gets the value None
def gen():
    result = yield from [1]
    print(result) #None?

generator = gen()
print(next(generator)) #1

next(generator)
 
what do you expect it to be?
 
I have no idea, probably None
 
AFAIK the return value of yield is whatever is sent to the generator from outside. so if you did generator.send('foo'), it'd print foo
 
yeah but yield and yield from expressions work differently
In my mind, it doesnt make sense for result to have a value if the yield from expression is yielding from a non-generator iterator
But IM not sure how Python assigns None to it
 
5:49 PM
> When the underlying iterator is complete, the value attribute of the raised StopIteration instance becomes the value of the yield expression. It can be either set explicitly when raising StopIteration, or automatically when the subiterator is a generator (by returning a value from the subgenerator).
 
Ok, but in this case, isn't the value of the yield expression computed BEFORE the StopIteration instance is created?
 
No. It's the value of the StopIteration raised by [1]
Maybe this helps:
def subgen():
    yield 1
    return 'foo'

def gen():
    result = yield from subgen()
    print(result)

for _ in gen(): pass
 
Isnt StopIteration raised at the final next(generator) line?
by next() itself?
 
Yes, there's a StopIteration raised there. But there's also a StopIteration raised by the list iterator that iterates over [1].
 
there are 3 StopIterations I'd say :P
 
6:00 PM
Why 3? O.o
 
def gen():
    try:
        result = yield from [1]
        print(result) #None?
    except StopIteration as e:
        print("Caught you!")

generator = gen()
print(next(generator)) #1

next(generator)
Then why cant I catch the Exception? (it doesn't output "Caught you")
 
@astralwolf yield from catches it
 
yield from catches it and turns it into its return value
 
ohhhh wow alright
 
not it but the value attribute...
 
6:01 PM
i never knew yield from could do that
 
def gen2():
    try:
        it = subgen()
        while True:
            yield next(it)
    except StopIteration as e:
        print("caught")
        print(e.value)
 
Was this documented anywhere? I never saw it while reading. Or maybe its obvious to some of you :P
 
6:17 PM
nothing is obvious. I hate the generator value sending, the coroutine stuff and all that.
I just read this yesterday: journal.stuffwithstuff.com/2015/02/01/…
(once again)
 
@AnttiHaapala Im new to Python (and programming), and its taken me a month of daily 3-4hr reading+experimenting to actually be able to mostly trace the flow of code with generators
In my (uneducated) opinion, the yield keyword seems to serve several different purposes which confused me. for example, the fact that its also an expression threw me off a bit
 
6:37 PM
@astralwolf forget the yield. you do not need it most of the time.
it is just a gimmick
I had programmed python for years making useful programs before it even appeared into the language or had any use.
(TBH the yield statement was there quite soon after I started Python but all the other meanings there are... those are gimmicks...)
 
 
2 hours later…
9:02 PM
```

class A:
def get_multi(
self, *,
is_available = True, *args, **kwargs

):
print('aaa')
return 'aaa'


a= A()

a.get_multi()
```
This throws syntax error, can you help me?
Error is not telling me much, I am not sure what to look for.
 
9:35 PM
after reading more I now see that * is doing similar thing as *args and I can't use both at the same time
 
 
2 hours later…
11:45 PM
def gen():
    try:
        yield 5
        return 10
    except:
        print("caught")

g = gen()
next(g) #5
next(g)
Why isnt the StopIteration raised by return 10 caught in the try-block?
Output is
Traceback (most recent call last):
  File "<string>", line 10, in <module>
StopIteration: 10
 

« first day (3998 days earlier)      last day (933 days later) »