On Fri, 24 Feb 2023 at 17:36, Greg Ewing via Python-list
wrote:
>
> On 24/02/23 9:26 am, avi.e.gr...@gmail.com wrote:
> > Python One-Liners: Write Concise, Eloquent Python Like a Professional
> > Illustrated Edition
> > by Christian Mayer (Author)
>
> I didn't know there were any Professional
On 24/02/23 9:26 am, avi.e.gr...@gmail.com wrote:
Python One-Liners: Write Concise, Eloquent Python Like a Professional
Illustrated Edition
by Christian Mayer (Author)
I didn't know there were any Professional Illustrated Editions
writing Pythom. You learn something every day! :-)
--
Greg
--
On 2/23/2023 7:21 PM, Hen Hanna wrote:
in a LaTeX file, after the (1st) \end{document} line,
i can put any random Junk i want(afterwards) until the end of the
file.
Is there a similar Method for a.py file ?
Since i know of no such trick, i sometimes
On 2/23/2023 10:58 PM, Cameron Simpson wrote:
On 23Feb2023 14:58, Hen Hanna wrote:
Python's Error-Msg genie (Jeannie) is cute and fickle... She
sometimes teases me by not telling me what the VALUE of the "int" is
( "That's for me to know, and for you to find
in a LaTeX file, after the (1st) \end{document} line,
i can put any random Junk i want(afterwards) until the end of the
file.
Is there a similar Method for a.py file ?
Since i know of no such trick, i sometimes put this (below) at the end of a
.py
We have been supplying many possible reasons or consequences for why the
implementation of python does not do what the OP wants and even DEMANDS.
I am satisfied with knowing it was because they CHOSE NOT TO in some places
and maybe not in others. It is nice to see some possible reasons, but
On 23Feb2023 14:58, Hen Hanna wrote:
Python's Error-Msg genie (Jeannie) is cute and fickle... She
sometimes teases me by not telling me what the VALUE of the "int" is
( "That's for me to know, and for you to find out!" )
as in:
On 24/02/2023 12.45, Weatherby,Gerard wrote:
NB my PyCharm-settings grumble whenever I create an identifier which
is
only used once (and perhaps, soon after it was established). I
understand the (space) optimisation, but prefer to trade that for
'readability'.
It isn't "space". Got an example
On 2/23/23 01:08, Hen Hanna wrote:
> Python VM is seeing an "int" object (123) (and telling me that) ...
> so it should be easy to print that "int" object
> What does Python VMknow ? and when does it know it ?
It knows there is an object and its name and type. It knows this from
On 23/02/2023 09.05, Hen Hanna wrote:
> py bug.py
Traceback (most recent call last):
File "C:\Usenet\bug.py", line 5, in
print( a + 12 )
TypeError: can only concatenate str (not "int") to str
Why doesn't Python (error msg) do
Many "warnings" can safely be ignored.
The function as shown does not look right. I assume it is just an example, but
a function that ignores the argument supplied is already a tad suspect.
Since it is SUGGESTED that the variable name "self" normally is used in a
method for a class/instance,
On 24/02/2023 12.45, Weatherby,Gerard wrote:
“
NB my PyCharm-settings grumble whenever I create an identifier which is
only used once (and perhaps, soon after it was established). I
understand the (space) optimisation, but prefer to trade that for
'readability'.
“
I haven’t seen that one. What
“
NB my PyCharm-settings grumble whenever I create an identifier which is
only used once (and perhaps, soon after it was established). I
understand the (space) optimisation, but prefer to trade that for
'readability'.
“
I haven’t seen that one. What I get is warnings about:
def is_adult( self
Python's Error-Msg genie (Jeannie) is cute and fickle... She sometimes
teases me by not telling me what the VALUE of the "int" is
( "That's for me to know, and for you to find out!" )
as in:
TypeError: can only concatenate str (not
On 22/02/2023 21.49, Robert Latest via Python-list wrote:
I found myself building a complicated logical condition with many ands and ors
which I made more manageable by putting the various terms on individual lines
and breaking them with the "\" line continuation character. In this context it
On Fri, 24 Feb 2023 at 06:29, Grant Edwards wrote:
>
> On 2023-02-23, rbowman wrote:
> > On Wed, 22 Feb 2023 18:25:00 -0800 (PST), Hen Hanna wrote:
> >
> >> i sometimes put extra commas... as:
> >>
> >>[ 1, 2, 3, 4, ]
> >>
> >> so it is (or may be)
On 2/23/23 12:29, Jim Byrnes wrote:
> I have been reading the python-list for some time now. At first via gemane
and since it's demise via a subscription.
> Recently I noticed that I have not received any emails for quite sometime.
>
> I tried resubscribing but still have received no emails
Good example, Rob, of how some people make what I consider RELIGIOUS edicts
that one can easily violate if one wishes and it makes lots of sense in your
example.
Let me extend that. The goal was to store a character string consisting of
multiple lines when printed that are all left-aligned.
Rob,
There are lots of nifty features each of us might like and insist make much
more sense than what others say they want.
Sometimes the answer is to not satisfy most of those demands but provide
TOOLS they can use to do things for themselves.
As you agree, many of us have found all kinds of
Rob,
It depends. Some purists say python abhors one liners. Well, I politely
disagree and I enjoyed this book which shows how to write some quite compressed
one-liners or nearly so.
Python One-Liners: Write Concise, Eloquent Python Like a Professional
Illustrated Edition
by Christian Mayer
Grant,
I am not sure it is fair to blame JSON for a design choice.
Use of commas can be done many ways in many contexts.
One context is a sort of placeholder. Can you have a language where a
function has multiple arguments and you can skip some as in:
Func(a,b,c)
Func(a, b,)
Func(a,,)
Or
On 2023-02-23, Jim Byrnes wrote:
> I have been reading the python-list for some time now. At first via
> gemane and since it's demise via a subscription.
FWIW, gmane is still there, and still working fine. I read this list
by pointing slrn at news.gmane.io
For whatever reason, python-list
I have been reading the python-list for some time now. At first via
gemane and since it's demise via a subscription. Recently I noticed that
I have not received any emails for quite sometime.
I tried resubscribing but still have received no emails from the list.
To my knowledge I have done
On 22/02/2023 15:23, Paul Bryan wrote:
Adding to this, there should be no reason now in recent versions of
Python to ever use line continuation. Black goes so far as to state
"backslashes are bad and should never be used":
On 2023-02-23, rbowman wrote:
> On Wed, 22 Feb 2023 18:25:00 -0800 (PST), Hen Hanna wrote:
>
>> i sometimes put extra commas... as:
>>
>>[ 1, 2, 3, 4, ]
>>
>> so it is (or may be) easier to add things later.
>
> That can bite you with things like
On 23/02/2023 02:25, Hen Hanna wrote:
i sometimes put extra commas... as:
[ 1, 2, 3, 4, ]
That is a good idea.
Even more so when the items are on separate lines:
[
"spam",
"eggs",
"cheese",
]
and you may want to
That is a reasonable use, Rob, albeit I would refactor that example in quite a
few ways so the need for a semicolon disappears even for lining things up.
So to extrapolate, perhaps a related example might be as simple as wanting to
initialialize multiple variables together might suffice as
On 23/02/2023 00:58, avi.e.gr...@gmail.com wrote:
So can anyone point to places in Python where a semicolon is part of a best
or even good way to do anything?
Yes. Take this bit of toy code which I just dreamed up. (Of course it
is toy code; don't bother telling me how it could be written
On 22/02/2023 20:05, Hen Hanna wrote:
Python makes programming (debugging) so easy
I agree with that!
Rob Cliffe
--
https://mail.python.org/mailman/listinfo/python-list
On Wednesday, February 22, 2023 at 11:57:45 PM UTC-8, Barry wrote:
> > On 23 Feb 2023, at 01:39, Hen Hanna wrote:
> >
> > On Wednesday, February 22, 2023 at 3:46:21 PM UTC-8, Hen Hanna wrote:
> >> On Wednesday, February 22, 2023 at 12:05:34 PM UTC-8, Hen Hanna wrote:
> py bug.py
> >>>
Thomas Passin wrote at 2023-2-22 21:04 -0500:
>On 2/22/2023 7:58 PM, avi.e.gr...@gmail.com wrote:
> ...
>> So can anyone point to places in Python where a semicolon is part of a best
>> or even good way to do anything?
>
>Mostly I use it to run small commands on the command line with python
>-c.
On Wed, 22 Feb 2023 18:25:00 -0800 (PST), Hen Hanna wrote:
> i sometimes put extra commas... as:
>
>[ 1, 2, 3, 4, ]
>
> so it is (or may be) easier to add things later.
That can bite you with things like JSON that aren't very forgiving. The
On 2/23/23 07:47, Mats Wichmann wrote:
On 2/23/23 06:03, Robin Becker wrote:
I'm trying to test python-3.12.0a5 and need to install lxml.
My wheel build for lxml fails with errors like this
src/lxml/etree.c: In function ‘__Pyx_PyIndex_AsSsize_t’:
src/lxml/etree.c:270404:45: error:
Greg,
How did you know that was the method I used to indicate I had properly
debugged and tested a line of code?
a = 5; pass
b = 7; pass
c = a * b; pass
Then I switched to using comments:
a = 5 # pass
b = 7 # pass
c = a * b # fail
And would you believe it still worked!
OK, I am just kidding
On 2/23/23 06:03, Robin Becker wrote:
I'm trying to test python-3.12.0a5 and need to install lxml.
My wheel build for lxml fails with errors like this
src/lxml/etree.c: In function ‘__Pyx_PyIndex_AsSsize_t’:
src/lxml/etree.c:270404:45: error: ‘PyLongObject’ {aka ‘struct
_longobject’} has no
I'm trying to test python-3.12.0a5 and need to install lxml.
My wheel build for lxml fails with errors like this
src/lxml/etree.c: In function ‘__Pyx_PyIndex_AsSsize_t’:
src/lxml/etree.c:270404:45: error: ‘PyLongObject’ {aka ‘struct _longobject’}
has no member named ‘ob_digit’
270404 |
> On 23 Feb 2023, at 01:39, Hen Hanna wrote:
>
> On Wednesday, February 22, 2023 at 3:46:21 PM UTC-8, Hen Hanna wrote:
>> On Wednesday, February 22, 2023 at 12:05:34 PM UTC-8, Hen Hanna wrote:
py bug.py
>>> Traceback (most recent call last):
>>> File "C:\Usenet\bug.py", line 5, in
37 matches
Mail list logo