Re: Question about learning Python

2022-09-09 Thread Chris Angelico
On Sat, 10 Sept 2022 at 06:45, Dennis Lee Bieber wrote: > > On Thu, 8 Sep 2022 07:42:19 +1200, dn > declaimed the following: > > >TSRs? Now that was an ugly period of history! (trying to make a > >single-process operating system do multi-processing - only to find that > >many program[me]s

Re: Question about learning Python

2022-09-09 Thread Chris Angelico
On Sat, 10 Sept 2022 at 06:38, Greg Ewing wrote: > > On 8/09/22 6:57 am, Chris Angelico wrote: > > Not as detrimental as starting with BASIC, and then moving on to x86 > > assembly language, and trying to massage the two together using CALL > > ABSOLUTE in order to get mouse input in your

Re: Question about learning Python

2022-09-09 Thread Dennis Lee Bieber
On Thu, 8 Sep 2022 07:42:19 +1200, dn declaimed the following: >TSRs? Now that was an ugly period of history! (trying to make a >single-process operating system do multi-processing - only to find that >many program[me]s assumed they had full use and undisputed control of >the computer. Happy

Re: Question about learning Python

2022-09-09 Thread Meredith Montgomery
writes: > Maybe we should ask WHY the person asking the question about how to learn a > computer language called Python is pairing it with the idea of whether to > also learn C. Excellent point! -- https://mail.python.org/mailman/listinfo/python-list

Re: Question about learning Python

2022-09-09 Thread Greg Ewing
On 8/09/22 6:57 am, Chris Angelico wrote: Not as detrimental as starting with BASIC, and then moving on to x86 assembly language, and trying to massage the two together using CALL ABSOLUTE in order to get mouse input in your GW-BASIC programs. Or starting with hand-assembled SC/MP machine code

Question about learning Python

2022-09-09 Thread Fulian Wang
Python-list on behalf of avi.e.gr...@gmail.com Sent: Wednesday, September 7, 2022 7:32:11 PM To: python-list@python.org Subject: RE: Question about learning Python Chris, I started with BASIC in high school and kept shifting my focus from one computer language to another long before I even

RE: Question about learning Python

2022-09-07 Thread avi.e.gross
: Re: Question about learning Python On Thu, 8 Sept 2022 at 04:54, Grant Edwards wrote: > > On 2022-09-07, Chris Angelico wrote: > > On Thu, 8 Sept 2022 at 01:50, Maruful Islam wrote: > >> > >> I want to start learning python. I have a question about learning p

RE: Question about learning Python

2022-09-07 Thread avi.e.gross
in C but can be done much nicer using Python costructs. -Original Message- From: Python-list On Behalf Of Meredith Montgomery Sent: Wednesday, September 7, 2022 3:35 PM To: python-list@python.org Subject: Re: Question about learning Python Maruful Islam writes: > I want to st

Re: Question about learning Python

2022-09-07 Thread Meredith Montgomery
Maruful Islam writes: > I want to start learning python. I have a question about learning python. > > Is learning C essential or not for learning python? Surely not necessary. There's a generous recent thread about books on Python. Have a look at it. -- https://mail.python.or

Re: Question about learning Python

2022-09-07 Thread dn
On 08/09/2022 07.15, Chris Angelico wrote: > On Thu, 8 Sept 2022 at 05:09, Grant Edwards wrote: >> >> On 2022-09-07, Chris Angelico wrote: >>> On Thu, 8 Sept 2022 at 04:54, Grant Edwards >>> wrote: >>> If you're a beginning programmer, then IMO learning C first is probably

Re: Question about learning Python

2022-09-07 Thread Chris Angelico
On Thu, 8 Sept 2022 at 05:09, Grant Edwards wrote: > > On 2022-09-07, Chris Angelico wrote: > > On Thu, 8 Sept 2022 at 04:54, Grant Edwards > > wrote: > > > >> If you're a beginning programmer, then IMO learning C first is > >> probably detrimental. [...] > > > > Not as detrimental as starting

Re: Question about learning Python

2022-09-07 Thread Grant Edwards
On 2022-09-07, Chris Angelico wrote: > On Thu, 8 Sept 2022 at 04:54, Grant Edwards wrote: > >> If you're a beginning programmer, then IMO learning C first is >> probably detrimental. [...] > > Not as detrimental as starting with BASIC, and then moving on to x86 > assembly language, and trying to

Re: Question about learning Python

2022-09-07 Thread Chris Angelico
On Thu, 8 Sept 2022 at 04:54, Grant Edwards wrote: > > On 2022-09-07, Chris Angelico wrote: > > On Thu, 8 Sept 2022 at 01:50, Maruful Islam wrote: > >> > >> I want to start learning python. I have a question about learning python. > >> > >> Is

Re: Question about learning Python

2022-09-07 Thread Grant Edwards
On 2022-09-07, Chris Angelico wrote: > On Thu, 8 Sept 2022 at 01:50, Maruful Islam wrote: >> >> I want to start learning python. I have a question about learning python. >> >> Is learning C essential or not for learning python? > > Absolutely not essential. In

Re: Question about learning Python

2022-09-07 Thread Chris Angelico
On Thu, 8 Sept 2022 at 01:50, Maruful Islam wrote: > > I want to start learning python. I have a question about learning python. > > Is learning C essential or not for learning python? Absolutely not essential. In fact, I would strongly recommend learning Python before ever picking u

Re: Question about learning Python

2022-09-07 Thread Thomas Passin
On 9/7/2022 6:28 AM, Maruful Islam wrote: I want to start learning python. I have a question about learning python. Is learning C essential or not for learning python? Not at all. -- https://mail.python.org/mailman/listinfo/python-list

Re: Question about learning Python

2022-09-07 Thread Lars Liedtke
Hello and welcome, the answer is a definitive "it depends" ;-) Generally you do not need knowledge in C for learning Python. But I'd say that it will not hurt to have some knowledge. Especially some packages use C-code to extend Python. But it seems to me that you are completel

Re: Question about learning Python

2022-09-07 Thread Sandro Volery
Hey Maruf > I want to start learning python. Good for you! Fun times ahead. > Is learning C essential or not for learning python? No, I would not say that learning C is essential for learning Python. However, C can serve as a great set of fundamentials in programming and understanding ma

Question about learning Python

2022-09-07 Thread Maruful Islam
I want to start learning python. I have a question about learning python. Is learning C essential or not for learning python? -- https://mail.python.org/mailman/listinfo/python-list

Re: learning python ...

2021-05-30 Thread 황병희
hw writes: > Hi, > > I'm starting to learn python and have made a little example program > following a tutorial[1] I'm attaching. > > Running it, I'm getting: > > > Traceback (most recent call last): > File "[...]/hworld.py", line 18, in > print(isinstance(int, float)) > TypeError:

Re: learning python ...

2021-05-28 Thread Michael Torrie
On 5/27/21 12:29 PM, hw wrote: > When the idea is to learn something, it's not exactly helpful to abandon > that idea when encountering the first obstacle or when someone tells you > you don't like it as much as they do ... We've had many new users approach the mailing list over the years.

RE: learning python ...

2021-05-27 Thread Avi Gross via Python-list
at important, use something else and do NOT suggest diddling with unused > bits in one implementation of NA to store your additional metadata as there > is no guarantee it will get the result you want and it is not a documented > guaranteed implementation and may break lots of other existing c

Re: learning python ...

2021-05-27 Thread Christian Gollwitzer
Am 25.05.21 um 06:08 schrieb hw: On 5/25/21 12:37 AM, Greg Ewing wrote: Python does have references to *objects*. All objects live on the heap and are kept alive as long as there is at least one reference to them. If you rebind a name, and it held the last reference to an object, there is no

Re: learning python ...

2021-05-27 Thread Michael F. Stemper
On 27/05/2021 16.13, Christian Gollwitzer wrote: Am 25.05.21 um 06:08 schrieb hw: On 5/25/21 12:37 AM, Greg Ewing wrote: Python does have references to *objects*. All objects live on the heap and are kept alive as long as there is at least one reference to them. If you rebind a name, and it

Re: learning python ...

2021-05-27 Thread Peter J. Holzer
On 2021-05-27 20:59:47 +0200, hw wrote: > On 5/25/21 3:09 PM, Greg Ewing wrote: > > On 25/05/21 5:56 pm, Avi Gross wrote: > > > Var = read in something from a file and make some structure like a > > > data.frame > > > Var = remove some columns from the above thing pointed to by Var > > > Var =

Re: learning python ...

2021-05-27 Thread hw
On 5/25/21 3:09 PM, Greg Ewing wrote: On 25/05/21 5:56 pm, Avi Gross wrote: Var = read in something from a file and make some structure like a data.frame Var = remove some columns from the above thing pointed to by Var Var = make some new calculated columns ditto Var = remove some rows ... Var

Re: learning python ...

2021-05-27 Thread hw
om: Python-list On Behalf Of Cameron Simpson Sent: Monday, May 24, 2021 5:34 AM To: python-list@python.org Subject: Re: learning python ... On 24May2021 08:21, hw wrote: On 5/24/21 12:03 AM, Cameron Simpson wrote: On 23May2021 21:02, Stestagg wrote: On Sun, 23 May 2021 at 20:37, hw wrote

Re: learning python ...

2021-05-26 Thread Greg Ewing
On 26/05/21 7:15 pm, hw wrote: it could at least figure out which, the type or the variable, to use as parameter for a function that should specify a variable type when the name is given.  Obviously, python knows what's expected, so why not chose that. It knows, but not until *after* the

Re: learning python ...

2021-05-26 Thread Chris Angelico
ople who > are trying to defend it. I tried to use it yesterday and failed because > the documentation of a library I wanted to use it with is bad, and > because maybe it wasn't such a good library. I would use it with > another library for another purpose, but there is no documentatio

Re: learning python ...

2021-05-26 Thread hw
d use it with another library for another purpose, but there is no documentation for that library at all, so I can't use it. So currently, it's not looking good for learning python. -- https://mail.python.org/mailman/listinfo/python-list

Re: learning python ...

2021-05-26 Thread hw
On 5/25/21 9:42 AM, Greg Ewing wrote: On 25/05/21 2:59 pm, hw wrote: Then what is 'float' in the case of isinstance() as the second parameter, and why can't python figure out what 'float' refers to in this case? You seem to be asking for names to be interpreted differently when they are

Re: learning python ...

2021-05-25 Thread Greg Ewing
On 2021-05-24, Alan Gauld via Python-list wrote: Although wouldn't it be "expected boolean expression" rather than conditional expression? Python doesn't care how the argument to 'if' is arrived at so long as it's a boolean. This isn't really true either. Almost every object in Python has an

Re: learning python ...

2021-05-25 Thread Greg Ewing
On 26/05/21 3:33 am, Dennis Lee Bieber wrote: the OBJECTS have a type and can not change type. Well... built-in types can't, but... >>> class A: ... pass ... >>> class B: ... pass ... >>> a = A() >>> type(a) >>> a.__class__ = B >>> type(a) -- Greg --

Re: learning python ...

2021-05-25 Thread Manfred Lotz
On Mon, 24 May 2021 08:14:39 +1200 Ron.Lauzon@f192.n1.z21.fsxnet (Ron Lauzon) wrote: > -=> hw wrote to All <=- > > hw> Traceback (most recent call last): > hw>File "[...]/hworld.py", line 18, in > hw> print(isinstance(int, float)) > hw> TypeError: isinstance() arg 2 must be a

Re: learning python ...

2021-05-25 Thread Michael F. Stemper
On 24/05/2021 18.30, Alan Gauld wrote: On 24/05/2021 16:54, Michael F. Stemper wrote: In my early days of writing python, I created lists named "list", dictionaries named "dict", and strings named "str". I mostly know better now, but sometimes still need to restrain my fingers. I think most

Re: learning python ...

2021-05-25 Thread Grant Edwards
On 2021-05-25, Michael F. Stemper wrote: > On 24/05/2021 23.08, hw wrote: >> On 5/25/21 12:37 AM, Greg Ewing wrote: >> >> Are all names references?  When I pass a name as a parameter to a >> function, does the object the name is referring to, when altered by the >> function, still appear

Re: learning python ...

2021-05-25 Thread Michael F. Stemper
On 24/05/2021 23.08, hw wrote: On 5/25/21 12:37 AM, Greg Ewing wrote: Python does have references to *objects*. All objects live on the heap and are kept alive as long as there is at least one reference to them. If you rebind a name, and it held the last reference to an object, there is no

Re: learning python ...

2021-05-25 Thread Grant Edwards
On 2021-05-25, Greg Ewing wrote: > On 25/05/21 5:56 pm, Avi Gross wrote: >> Var = read in something from a file and make some structure like a data.frame >> Var = remove some columns from the above thing pointed to by Var >> Var = make some new calculated columns ditto >> Var = remove some rows

Re: learning python ...

2021-05-25 Thread Grant Edwards
On 2021-05-24, Alan Gauld via Python-list wrote: > On 24/05/2021 19:48, Grant Edwards wrote: > >>> Traceback ( File "", line 1 >>> if = 1.234 >>>^ >>> SyntaxError: invalid syntax >> >> I must admit it might be nice if the compiler told you _why_ the >> syntax is invalid (e.g.

Re: learning python ...

2021-05-25 Thread Greg Ewing
On 25/05/21 5:56 pm, Avi Gross wrote: Var = read in something from a file and make some structure like a data.frame Var = remove some columns from the above thing pointed to by Var Var = make some new calculated columns ditto Var = remove some rows ... Var = set some kind of grouping on the

Re: learning python ...

2021-05-25 Thread Greg Ewing
On 25/05/21 2:59 pm, hw wrote: Then what is 'float' in the case of isinstance() as the second parameter, and why can't python figure out what 'float' refers to in this case? You seem to be asking for names to be interpreted differently when they are used as parameters to certain functions.

Re: learning python ...

2021-05-25 Thread Alan Gauld via Python-list
On 25/05/2021 00:41, Jon Ribbens via Python-list wrote: > What would you call the argument to a function that > returns, say, an upper-cased version of its input? Probably 'candidate' or 'original' or 'initial' or somesuch. Or even just 's'. Single character names are OK when there is no

Re: learning python ...

2021-05-25 Thread Michael Torrie
On 5/24/21 9:53 PM, hw wrote: > That seems like an important distinction. I've always been thinking of > variables that get something assigned to them, not as something that is > being assigned to something. Your thinking is not incorrect. Assignment is how you set a variable to something.

Re: learning python ...

2021-05-25 Thread Richard Damon
On 5/25/21 12:08 AM, hw wrote: > > Are all names references?  When I pass a name as a parameter to a > function, does the object the name is referring to, when altered by > the function, still appear altered after the function has returned?  I > wouldn't expect that ... If you mutate the object

Shadowing, was Re: learning python ...

2021-05-25 Thread Peter Otten
On 25/05/2021 05:20, hw wrote: We're talking about many different things. If it's simply "num = ..." followed by "num = ...", then it's not a new variable or anything, it's simply rebinding the same name. But when you do "int = ...", it's shadowing the builtin name. Why?  And how is that

Re: learning python ...

2021-05-25 Thread Chris Angelico
On Tue, May 25, 2021 at 1:00 PM hw wrote: > > On 5/24/21 3:54 PM, Chris Angelico wrote: > > You keep using that word "unfinished". I do not think it means what > > you think it does. > > What do you think I think it means? I think it means that the language is half way through development,

RE: learning python ...

2021-05-24 Thread Avi Gross via Python-list
many LIKE IT the way it is, ... -Original Message- From: Python-list On Behalf Of Cameron Simpson Sent: Monday, May 24, 2021 5:34 AM To: python-list@python.org Subject: Re: learning python ... On 24May2021 08:21, hw wrote: >On 5/24/21 12:03 AM, Cameron Simpson wrote: >>On 23May2

Re: learning python ...

2021-05-24 Thread Cameron Simpson
On 25May2021 06:08, hw wrote: >On 5/25/21 12:37 AM, Greg Ewing wrote: >>If you rebind a name, and it held the last reference to an >>object, there is no way to get that object back. > >Are all names references? Yes. >When I pass a name as a parameter to a function, does the object the >name is

Re: learning python ...

2021-05-24 Thread Cameron Simpson
On 25May2021 05:53, hw wrote: >That seems like an important distinction. I've always been thinking of >variables that get something assigned to them, not as something that is >being assigned to something. They are what you thought. But it's references to objects what are being passed around.

Re: learning python ...

2021-05-24 Thread hw
On 5/25/21 12:37 AM, Greg Ewing wrote: On 25/05/21 9:27 am, Cameron Simpson wrote: On 24May2021 16:17, hw wrote: > Or it doesn't forget about the old one and the old one becomes inaccessible (unless you have a reference to it, if there is such a thing in python).  How do you call that?

Re: learning python ...

2021-05-24 Thread hw
On 5/24/21 4:28 PM, Michael Torrie wrote: On 5/24/21 8:17 AM, hw wrote: What does python actually do in the first example? Does it overshadow a variable or does it change one? If it overshadows a variable, it would be dubious, if it doesn't, it won't be dubious. Are you referring to this?

Re: learning python ...

2021-05-24 Thread hw
On 5/24/21 4:37 PM, Chris Angelico wrote: On Tue, May 25, 2021 at 12:31 AM Michael Torrie wrote: On 5/24/21 8:24 AM, Chris Angelico wrote: On Tue, May 25, 2021 at 12:18 AM hw wrote: There are more alternatives: Python might create a new variable with the same name and forget about the old

Re: learning python ...

2021-05-24 Thread hw
On 5/24/21 4:41 PM, Michael Torrie wrote: On 5/24/21 8:21 AM, Michael Torrie wrote: Given your posts thus far, hw, I don't think Python is a good fit for you. You're better off learning a language that more closely aligns with the statically-typed languages you already know. Maybe it is,

Re: learning python ...

2021-05-24 Thread hw
On 5/24/21 3:54 PM, Chris Angelico wrote: On Mon, May 24, 2021 at 11:35 PM hw wrote: On 5/24/21 9:52 AM, Chris Angelico wrote: Does C give you a warning if you create a function-local variable called "printf"? No, and it shouldn't. Does any other language complain if you use its scoping

Re: learning python ...

2021-05-24 Thread Jon Ribbens via Python-list
On 2021-05-24, Alan Gauld wrote: > On 24/05/2021 16:54, Michael F. Stemper wrote: > >> In my early days of writing python, I created lists named "list", >> dictionaries named "dict", and strings named "str". I mostly know better >> now, but sometimes still need to restrain my fingers. > > I think

Re: learning python ...

2021-05-24 Thread Alan Gauld via Python-list
On 24/05/2021 19:48, Grant Edwards wrote: >> Traceback ( File "", line 1 >> if = 1.234 >>^ >> SyntaxError: invalid syntax > > I must admit it might be nice if the compiler told you _why_ the > syntax is invalid (e.g. "expected conditional expression while parsing > 'if' statement").

Re: learning python ...

2021-05-24 Thread Alan Gauld via Python-list
On 24/05/2021 16:54, Michael F. Stemper wrote: > In my early days of writing python, I created lists named "list", > dictionaries named "dict", and strings named "str". I mostly know better > now, but sometimes still need to restrain my fingers. I think most newbie programmers make that mistake.

Re: learning python ...

2021-05-24 Thread Dan Stromberg
On Sun, May 23, 2021 at 12:35 PM hw wrote: > I don't know about shadowing. If I have defeated a whole variable type > by naming a variable like a variable type, I would think it is a bad > idea for python to allow this without warning. It seems like a recipie > for creating chaos. > It

Re: learning python ...

2021-05-24 Thread Greg Ewing
On 25/05/21 9:27 am, Cameron Simpson wrote: On 24May2021 16:17, hw wrote: > Or it doesn't forget about the old one and the old one becomes inaccessible (unless you have a reference to it, if there is such a thing in python). How do you call that? You're conflating values (objects, such as

Re: learning python ...

2021-05-24 Thread Cameron Simpson
On 24May2021 16:17, hw wrote: >On 5/24/21 11:33 AM, Cameron Simpson wrote: >>Note that in this function: >> >> x = 1 >> y = 2 >> >> def f(a): >> x = 3 >> print(x, y) >> >>"x" is local, because the function contains an assignment to it. "y" >>comes from an outer scope

Re: learning python ...

2021-05-24 Thread Grant Edwards
On 2021-05-24, Dennis Lee Bieber wrote: > Attempting to rebind a keyword in Python will produce an error... > if = 1.234 > Traceback ( File "", line 1 > if = 1.234 >^ > SyntaxError: invalid syntax I must admit it might be nice if the compiler told you _why_ the syntax is

Re: learning python ...

2021-05-24 Thread Alan Gauld via Python-list
On 24/05/2021 07:21, hw wrote: >> Inside the function f() the name 'x" shadows the global "x"; references >> to "x" are to the function's local vairable. Which is very desireable. > > If it works that way, I would consider it an entirely different > variable. Remember that in Python

Re: learning python ...

2021-05-24 Thread Michael F. Stemper
On 24/05/2021 09.32, Rob Cliffe wrote: One day you may want to write (as you can in Python)     class int(int):         . to shadow the built-in 'int' type with a modified version.  I'm not suggesting this has many real world applications, but it can be fun to play with.  Python has a

Re: learning python ...

2021-05-24 Thread Rob Cliffe via Python-list
Please don't be put off by your experience so far.  Everyone stumbles along the way and runs into "gotchas" when learning a new language.  Python is a fantastic language for development.  One of my early "epiphany" moments was experimenting with different algorithms to try to find the right

Re: learning python ...

2021-05-24 Thread Michael Torrie
On 5/24/21 8:42 AM, Schachner, Joseph wrote: > OMG that is awful abuse of Python! You have overloaded two Python > keywords by making variables of that name. Nitpick. hw did not overload keywords. Python does not allow keywords to be overloaded. Instead hw overwrote type names. Upon learning

Re: learning python ...

2021-05-24 Thread Rob Cliffe via Python-list
On 24/05/2021 14:34, hw wrote: Your claim that I'm insulting python or anoyone is ridiculous. According to your logic, C is insulting python.  I suggest you stop making assumptions. Calling a mature, widely used language "unfinished" because of what *you* see as a defect *is* insulting.

Re: learning python ...

2021-05-24 Thread Michael Torrie
On 5/24/21 8:37 AM, Chris Angelico wrote: > We're talking about many different things. Indeed. The context of that original question about whether this was shadowing or not seemed to be specifically about the num=input(); num=int(num) example that Cameron Simpson posted. Although hw was not

RE: learning python ...

2021-05-24 Thread Schachner, Joseph
)). The first argument is the variable, the second should be type name. --- Joseph S. Teledyne Confidential; Commercially Sensitive Business Data -Original Message- From: hw Sent: Sunday, May 23, 2021 3:34 PM To: python-list@python.org Subject: Re: learning python ... On 5/23/21 7:28 PM

Re: learning python ...

2021-05-24 Thread Michael Torrie
On 5/24/21 8:21 AM, Michael Torrie wrote: > Given your posts thus far, hw, I don't think Python is a good fit for > you. You're better off learning a language that more closely aligns with > the statically-typed languages you already know. That was unnecessarily harsh; my apologies. I can see

Re: learning python ...

2021-05-24 Thread Chris Angelico
On Tue, May 25, 2021 at 12:31 AM Michael Torrie wrote: > > On 5/24/21 8:24 AM, Chris Angelico wrote: > > On Tue, May 25, 2021 at 12:18 AM hw wrote: > >> There are more alternatives: Python might create a new variable with > >> the same name and forget about the old one. Or it doesn't forget

Re: learning python ...

2021-05-24 Thread Michael Torrie
On 5/24/21 8:17 AM, hw wrote: > What does python actually do in the first example? Does it overshadow a > variable or does it change one? If it overshadows a variable, it would > be dubious, if it doesn't, it won't be dubious. Are you referring to this? num = input("Enter a number: ")

Re: learning python ...

2021-05-24 Thread Michael Torrie
On 5/24/21 8:24 AM, Chris Angelico wrote: > On Tue, May 25, 2021 at 12:18 AM hw wrote: >> There are more alternatives: Python might create a new variable with >> the same name and forget about the old one. Or it doesn't forget about >> the old one and the old one becomes inaccessible (unless

Re: learning python ...

2021-05-24 Thread Chris Angelico
On Tue, May 25, 2021 at 12:18 AM hw wrote: > There are more alternatives: Python might create a new variable with > the same name and forget about the old one. Or it doesn't forget about > the old one and the old one becomes inaccessible (unless you have a > reference to it, if there is such a

Re: learning python ...

2021-05-24 Thread Michael Torrie
e like Scheme or LISP! Or Smalltalk! What is your purpose here? Why are you learning Python when it's apparently that you have very little desire to understand the hows and whys of Python and its idioms and paradigms, and to find its strengths. You've encountered some things that to you are unex

Re: learning python ...

2021-05-24 Thread hw
On 5/24/21 11:33 AM, Cameron Simpson wrote: On 24May2021 08:21, hw wrote: On 5/24/21 12:03 AM, Cameron Simpson wrote: On 23May2021 21:02, Stestagg wrote: On Sun, 23 May 2021 at 20:37, hw wrote: I don't know about shadowing. Shadowing is effectively saying “within this bit of code,

Re: learning python ...

2021-05-24 Thread Chris Angelico
On Mon, May 24, 2021 at 11:35 PM hw wrote: > > On 5/24/21 9:52 AM, Chris Angelico wrote: > > Does C give you a warning if you create a function-local variable > > called "printf"? No, and it shouldn't. Does any other language > > complain if you use its scoping rules to reuse a name? Nope. Does >

Re: learning python ...

2021-05-24 Thread hw
On 5/24/21 9:52 AM, Chris Angelico wrote: On Mon, May 24, 2021 at 3:25 PM hw wrote: On 5/23/21 10:02 PM, Stestagg wrote: On Sun, 23 May 2021 at 20:37, hw mailto:h...@adminart.net>> wrote: On 5/23/21 7:28 PM, Peter Otten wrote: > On 23/05/2021 06:37, hw wrote: >> >>

Re: learning python ...

2021-05-24 Thread Cameron Simpson
On 24May2021 08:21, hw wrote: >On 5/24/21 12:03 AM, Cameron Simpson wrote: >>On 23May2021 21:02, Stestagg wrote: >>>On Sun, 23 May 2021 at 20:37, hw wrote: I don't know about shadowing. >>> >>>Shadowing is effectively saying “within this bit of code, (scope) I’m going >>>to use an

Re: learning python ...

2021-05-24 Thread Peter J. Holzer
On 2021-05-24 07:20:39 +0200, hw wrote: > python is too unfinished to be used. You have to realize that different programming languages have different goals and develop in different directions. Python is not an "unfinished Java" (and neither is Java an "unfinished Python"). The scoping and

Re: learning python ...

2021-05-24 Thread Chris Angelico
On Mon, May 24, 2021 at 3:25 PM hw wrote: > > On 5/23/21 10:02 PM, Stestagg wrote: > > > > > > On Sun, 23 May 2021 at 20:37, hw > > wrote: > > > > On 5/23/21 7:28 PM, Peter Otten wrote: > > > On 23/05/2021 06:37, hw wrote: > > >> > > >> Hi, > >

Re: learning python ...

2021-05-24 Thread hw
On 5/24/21 12:03 AM, Cameron Simpson wrote: On 23May2021 21:02, Stestagg wrote: On Sun, 23 May 2021 at 20:37, hw wrote: I don't know about shadowing. Shadowing is effectively saying “within this bit of code, (scope) I’m going to use an already-used name for my own value” An example might

Re: learning python ...

2021-05-23 Thread hw
PS: On 5/24/21 7:20 AM, hw wrote: There is even no indication from the output from the program before it aborts with an error message that something might be wrong:  For 'type(float)', it prints "" just like it does for int. How is anyone supposed to debug stuff like that? Ok, it prints ""

Re: learning python ...

2021-05-23 Thread Igor Korot
kinds of situations in which > something like that happens, and you can spend hours or days trying to > figure out what's wrong and may never find it. > > > One thing to learn to > > look out for is if you assign to a name, then use that name on a > > different contex

Re: learning python ...

2021-05-23 Thread hw
supposed to debug stuff like that? Why doesn't print(type(float)) give an error message after the variable type was already defeated (or prints something else)? What is it actually printing? It seems like a recipie for creating chaos. Luckily almost every python code checker and/or

Re: learning python ...

2021-05-23 Thread Cameron Simpson
On 23May2021 21:02, Stestagg wrote: >On Sun, 23 May 2021 at 20:37, hw wrote: >> I don't know about shadowing. > >Shadowing is effectively saying “within this bit of code, (scope) I’m going >to use an already-used name for my own value” An example might make this clearer: x = 1 # global

Re: learning python ...

2021-05-23 Thread Stestagg
3 made this a little bit better by stopping you from rebinding (shadowing) a number of built ins, such as True and False. In your case, I agree that it is super confusing. One thing to learn to look out for is if you assign to a name, then use that name on a different context, expecting it to be different, then that’s not likely to work as you expect. It seems like a recipie > for creating chaos. Luckily almost every python code checker and/or linter will highlight this for you. If you’re learning python, I’d highly recommend doing so in an ide or editor that has a code checker running. > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list

Re: learning python ...

2021-05-23 Thread MRAB
On 2021-05-23 20:34, hw wrote: On 5/23/21 7:28 PM, Peter Otten wrote: On 23/05/2021 06:37, hw wrote: Hi, I'm starting to learn python and have made a little example program following a tutorial[1] I'm attaching. Running it, I'm getting: Traceback (most recent call last):    File

Re: learning python ...

2021-05-23 Thread hw
On 5/23/21 7:28 PM, Peter Otten wrote: On 23/05/2021 06:37, hw wrote: Hi, I'm starting to learn python and have made a little example program following a tutorial[1] I'm attaching. Running it, I'm getting: Traceback (most recent call last):    File "[...]/hworld.py", line 18, in

Re: learning python ...

2021-05-23 Thread Peter Otten
On 23/05/2021 06:37, hw wrote: Hi, I'm starting to learn python and have made a little example program following a tutorial[1] I'm attaching. Running it, I'm getting: Traceback (most recent call last):   File "[...]/hworld.py", line 18, in     print(isinstance(int, float)) TypeError:

learning python ...

2021-05-23 Thread hw
Hi, I'm starting to learn python and have made a little example program following a tutorial[1] I'm attaching. Running it, I'm getting: Traceback (most recent call last): File "[...]/hworld.py", line 18, in print(isinstance(int, float)) TypeError: isinstance() arg 2 must be a type

Re: learning python building 2nd app, need advices

2021-01-13 Thread Phil Boutros
Loris Bennett wrote: > As an Emacs user, personally I would use the command > > M-x untabify > > within Emacs. I assume that Vim has something similar. It does. ':retab' is what you want. If you have tabstop set to a specific value, it'll use that. If not, you can do ':retab ', where

Re: learning python building 2nd app, need advices

2021-01-11 Thread Grant Edwards
On 2021-01-11, 2qdxy4rzwzuui...@potatochowder.com <2qdxy4rzwzuui...@potatochowder.com> wrote: > On 2021-01-11 at 06:34:42 -0800, > pascal z via Python-list wrote: > >> On Monday, January 11, 2021 at 2:07:03 PM UTC, Chris Angelico wrote: > >> > Easy fix: stop looking at the Google Group page. >>

Re: learning python building 2nd app, need advices

2021-01-11 Thread Grant Edwards
On 2021-01-11, pascal z via Python-list wrote: > tab to space on linux is not something easy to do, Nonsense, there's a command _specifically_ for that: $ man expand -- Grant -- https://mail.python.org/mailman/listinfo/python-list

Re: learning python building 2nd app, need advices

2021-01-11 Thread Terry Reedy
On 1/11/2021 6:46 AM, pascal z via Python-list wrote: tab to space on linux is not something easy to do, IDLE has a tab to spaces command on the format menu. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: learning python building 2nd app, need advices

2021-01-11 Thread 2QdxY4RzWzUUiLuE
On 2021-01-11 at 06:34:42 -0800, pascal z via Python-list wrote: > On Monday, January 11, 2021 at 2:07:03 PM UTC, Chris Angelico wrote: > > Easy fix: stop looking at the Google Group page. > > > > ChrisA > ok, emails show post fine. 10 years ago or something, I was quite > involved to

Re: learning python building 2nd app, need advices

2021-01-11 Thread pascal z via Python-list
On Monday, January 11, 2021 at 2:07:03 PM UTC, Chris Angelico wrote: > On Tue, Jan 12, 2021 at 1:01 AM pascal z via Python-list > wrote: > > > > On Monday, January 11, 2021 at 1:45:31 PM UTC, Greg Ewing wrote: > > > On 12/01/21 1:12 am, pascal z wrote: > > > > As alternative, I pasted it

Re: learning python building 2nd app, need advices

2021-01-11 Thread Chris Angelico
On Tue, Jan 12, 2021 at 1:01 AM pascal z via Python-list wrote: > > On Monday, January 11, 2021 at 1:45:31 PM UTC, Greg Ewing wrote: > > On 12/01/21 1:12 am, pascal z wrote: > > > As alternative, I pasted it into github and pasted it back into this > > > page, it's ok when pasting but when

Re: learning python building 2nd app, need advices

2021-01-11 Thread pascal z via Python-list
On Monday, January 11, 2021 at 1:45:31 PM UTC, Greg Ewing wrote: > On 12/01/21 1:12 am, pascal z wrote: > > As alternative, I pasted it into github and pasted it back into this page, > > it's ok when pasting but when posting it fails keeping spaces... > The indentation in your last three posts

Re: learning python building 2nd app, need advices

2021-01-11 Thread Greg Ewing
On 12/01/21 1:12 am, pascal z wrote: As alternative, I pasted it into github and pasted it back into this page, it's ok when pasting but when posting it fails keeping spaces... The indentation in your last three posts looks fine here in the comp.lang.python newsgroup. If it doesn't look right

Re: learning python building 2nd app, need advices

2021-01-11 Thread pascal z via Python-list
On Monday, January 11, 2021 at 12:00:28 PM UTC, Loris Bennett wrote: > pascal z writes: > > > tab to space on linux is not something easy to do > > I would argue that you are mistaken, although that depends somewhat on > your definition of 'easy'. > > > , I had to launch windows and use

  1   2   3   4   5   6   >