Re: .0 in name

2022-05-28 Thread Chris Angelico
On Sun, 29 May 2022 at 08:26, Eryk Sun wrote: > > On 5/28/22, Chris Angelico wrote: > > > > be extremely confusing; so to keep everything safe, the interpreter > > generates a name you couldn't possibly want - same as for the function > > itself, which is named "" or "", angle brackets > >

Re: .0 in name

2022-05-28 Thread Eryk Sun
On 5/28/22, Chris Angelico wrote: > > be extremely confusing; so to keep everything safe, the interpreter > generates a name you couldn't possibly want - same as for the function > itself, which is named "" or "", angle brackets > included. To clarify, "" is the co_name and co_qualname value of

Re: .0 in name

2022-05-28 Thread Chris Angelico
ntifier. An identifier cannot > > begin with a decimal number. > > I'm not sure about the first statement. Feeding > > [print("locals:", locals()) or c for c in "ab"] > > to the REPL, the result is > > locals: {'.0': , 'c': 'a'} > locals: {'

Re: .0 in name

2022-05-28 Thread Ralf M.
. Feeding [print("locals:", locals()) or c for c in "ab"] to the REPL, the result is locals: {'.0': , 'c': 'a'} locals: {'.0': , 'c': 'b'} ['a', 'b'] i.e. there is a variable of name .0 in the local namespace within the list comprehension, and .0 is definitely not an identif

Re: .0 in name

2022-05-13 Thread Avi Gross via Python-list
ering name like __init__ ... -Original Message- From: dn To: python-list@python.org Sent: Sat, May 14, 2022 12:33 am Subject: Re: .0 in name This is not what @Avi menat by "silly variable names" but: 3D_position 2nd_floor_area 3M_PostIt_size 3rd_degree_polynom

Re: .0 in name

2022-05-13 Thread dn
This is not what @Avi menat by "silly variable names" but: 3D_position 2nd_floor_area 3M_PostIt_size 3rd_degree_polynomial 360_degree_view 12_hours_later and ??? 2_fast_2_furious -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: .0 in name

2022-05-13 Thread Avi Gross via Python-list
 ❽ -Original Message- From: Avi Gross via Python-list To: python-list@python.org Sent: Fri, May 13, 2022 6:02 pm Subject: Re: .0 in name Bryan, As has been pointed out, it is very common in possibly all programming languages to not allow digits at the start of many identifiers. It make

Re: .0 in name

2022-05-13 Thread Paul Bryan
On Fri, 2022-05-13 at 22:02 +, Avi Gross via Python-list wrote: > So why you wonder where it is documented that variables cannot be > what you feel like is a bit puzzling!  I had just assumed on good faith that the request to the documentation would be so that the OP could determine what is

Re: .0 in name

2022-05-13 Thread Avi Gross via Python-list
rame with embedded spaces and other anomalies requiring special handling. So why you wonder where it is documented that variables cannot be what you feel like is a bit puzzling!  -Original Message- From: bryangan41 To: python-list@python.org Sent: Fri, May 13, 2022 12:47 pm Subject: .0 i

Re: .0 in name

2022-05-13 Thread Paul Bryan
On Sat, 2022-05-14 at 00:47 +0800, bryangan41 wrote: > May I know (1) why can the name start with a number? The name of an attribute must be an identifier. An identifier cannot begin with a decimal number. > (2) where in the doc is it?!

.0 in name

2022-05-13 Thread bryangan41
May I know (1) why can the name start with a number?(2) where in the doc is it?!>>> import pdb>>> pdb.run('(a for a in "")')> (1)()(Pdb) s--Call--> (1)()(Pdb) a.0 = (Pdb) c>>>Sent from Samsung tablet. -- https://mail.python.org/mailman/listinfo/python-list