On 5/29/2024 10:59 AM, MRAB via Python-list wrote:
On 2024-05-29 15:32, Thomas Passin via Python-list wrote:
On 5/29/2024 8:55 AM, Kevin M. Wilson wrote:
Please recall, I said the format for the email failed to retain the
proper indents.
I'll attach a picture of the code!
Purpose; to
On 2024-05-29, Mats Wichmann via Python-list wrote:
> On 5/29/24 08:02, Grant Edwards via Python-list wrote:
>> On 2024-05-29, Chris Angelico via Python-list wrote:
>>
>>> print(f"if block {name[index]=} {index=}")
>>
>> Holy cow! How did I not know about the f-string {=} thing?
>
> It's more
On 2024-05-29 15:32, Thomas Passin via Python-list wrote:
On 5/29/2024 8:55 AM, Kevin M. Wilson wrote:
Please recall, I said the format for the email failed to retain the
proper indents.
I'll attach a picture of the code!
Purpose; to uppercase every other letter in a string.
Thanks all, KMW
> On 29 May 2024, at 05:38, Kevin M. Wilson via Python-list
> wrote:
>
> The format in this email is not of my making, should someone know, how to do
> this so that it's a readable script do tell!
> KMW
Your mail program may have a plain-text mode to compose messages in try using
that.
On 5/29/2024 8:55 AM, Kevin M. Wilson wrote:
Please recall, I said the format for the email failed to retain the
proper indents.
I'll attach a picture of the code!
Purpose; to uppercase every other letter in a string.
Thanks all, KMW
Simpler is good, and readability is good. For a simple
On 5/29/24 08:02, Grant Edwards via Python-list wrote:
On 2024-05-29, Chris Angelico via Python-list wrote:
print(f"if block {name[index]=} {index=}")
Holy cow! How did I not know about the f-string {=} thing?
It's more recent than f-strings in general, so it's not that hard to miss.
--
On 2024-05-29, Chris Angelico via Python-list wrote:
> print(f"if block {name[index]=} {index=}")
Holy cow! How did I not know about the f-string {=} thing?
--
Grant
--
https://mail.python.org/mailman/listinfo/python-list
On Wed, 29 May 2024 at 23:06, Dan Sommers via Python-list
wrote:
> (For the history-impaired, getopt existed long before Python and will
> likely exist long after it, but getopt's "replacement" optparse lasted
> only from 2003 until 2011.)
Depends on your definition of "lasted". It's not getting
On 2024-05-29 at 17:14:51 +1000,
Chris Angelico via Python-list wrote:
> I wouldn't replace str.format() everywhere, nor would I replace
> percent encoding everywhere - but in this case, I think Thomas is
> correct. Not because it's 2024 (f-strings were brought in back in
> 2015, so they're
On 5/29/2024 3:14 AM, Chris Angelico via Python-list wrote:
On Wed, 29 May 2024 at 16:03, Cameron Simpson via Python-list
wrote:
By which Thomas means stuff like this:
print(f'if block {name[index]} and index {index}')
Notice the leading "f'". Personally I wouldn't even go that far,
}, letter is {}'.format(index, name)) # print('letter
to lower = {}'.format(name[index])) # print('Already lowercase do noting:
name = {}'.format(name[index])) index += 1 # index = name.upper()
return name
myfunc('capitalism')
Erro
On Wed, 29 May 2024 at 16:03, Cameron Simpson via Python-list
wrote:
> By which Thomas means stuff like this:
>
> print(f'if block {name[index]} and index {index}')
>
> Notice the leading "f'". Personally I wouldn't even go that far, just:
>
> print('if block', name[index], 'and index',
On 29May2024 01:14, Thomas Passin wrote:
Also, it's 2024 ... time to start using f-strings (because they are
more readable than str.format())
By which Thomas means stuff like this:
print(f'if block {name[index]} and index {index}')
Notice the leading "f'". Personally I wouldn't even go
se do noting:
name = {}'.format(name[index])) index += 1 # index = name.upper()
return name
myfunc('capitalism')
Error message: Not making sense, index is 1, letter s/b
'a'letter to upper = c, index 0!
if block C and index 0
1
Start: elseif block, inde
:
Flubbed it in the second interation through the string: range error... HOW?
The following is my effort to understand how to process a string, letter, by
letter:
def myfunc(name): index = 0 howmax = len(name) # while (index <=
howmax): while (index < howmax): if (index % 2 == 0):
to lower =
{}'.format(name[index])) # print('Already lowercase do noting: name
= {}'.format(name[index])) index += 1 # index = name.upper()
return name
myfunc('capitalism')
Error message: Not making sense, index is 1, l
When running the code below , I get error as enumerated below. Why am I
not able to trap this paramiko runtime traceback in try-except block ?
Exception (client): Error reading SSH protocol banner
Traceback (most recent call last):
File
"/home/uzi/.local/lib/python3.8/site-packages/par
I think I have seen this error being discussed before…
A web search for pyinstaller and that error leads to people discussing why it
happens it looks like.
Barry
--
https://mail.python.org/mailman/listinfo/python-list
--
https://mail.python.org/mailman/listinfo/python-list
ce is versatile..."
On 2024/03/31 14:51, Barry wrote:
On 31 Mar 2024, at 13:24, Jacob Kruger via Python-list
wrote:
pkg_resources.DistributionNotFound: The 'altgraph' distribution was not found
and is required by the application
I think I have seen this error being discussed b
ote:
>>>
>>> pkg_resources.DistributionNotFound: The 'altgraph' distribution was not
>>> found and is required by the application
>> I think I have seen this error being discussed before…
>>
>> A web search for pyinstaller and that error leads to people discussing why
>> it happens it looks like.
>>
>> Barry
>>
>>
> --
> https://mail.python.org/mailman/listinfo/python-list
--
https://mail.python.org/mailman/listinfo/python-list
'altgraph' distribution was not found
and is required by the application
I think I have seen this error being discussed before…
A web search for pyinstaller and that error leads to people discussing why it
happens it looks like.
Barry
--
https://mail.python.org/mailman/listinfo/python-list
> On 31 Mar 2024, at 13:24, Jacob Kruger via Python-list
> wrote:
>
> pkg_resources.DistributionNotFound: The 'altgraph' distribution was not found
> and is required by the application
I think I have seen this error being discussed before…
A web search for pyinstaller and t
This started happening this past week, and, while it's worked fine in
the past, the moment I try to launch the pyinstaller process at all, to
generate compiled output, or even if just launch it with no command line
options, I receive the following error message
Thank you for the information.
On Mon, Mar 11, 2024, 22:36 wrote:
> Sanskar Mukeshbhai Joshi wrote at 2024-3-10 18:08 +:
> >I had made my project in BCA in Python. When I had complete my project
> and run the program, at that time I got the error in runnig my project.
Sanskar Mukeshbhai Joshi wrote at 2024-3-10 18:08 +:
>I had made my project in BCA in Python. When I had complete my project and run
>the program, at that time I got the error in runnig my project. The error was
>ModuleNotFoundError: No module named 'flask'.
`flask` is
On 10/03/2024 18:08, Sanskar Mukeshbhai Joshi via Python-list wrote:
> I had made my project in BCA in Python. When I had complete my
> project and run the program, at that time I got the error in
> runnig my project. The error was ModuleNotFoundError: No module named 'flask'.
Flask i
Respected Sir/Ma'am
I had made my project in BCA in Python. When I had complete my project and run
the program, at that time I got the error in runnig my project. The error was
ModuleNotFoundError: No module named 'flask'.
I request you to check this problem and resolve it or guide me to solve
now I get:
File e:\getmodpot.py:40
fig,ax = initPlot()
File E:\mystuff.py:272 in initPlot
fig,ax = plt.subplots(figsize=(xs,ys))
File ~\anaconda3\Lib\site-packages\matplotlib\pyplot.py:1501 in subplots
fig = figure(**fig_kw)
File
On Sunday, February 18, 2024 at 10:48:29 PM UTC+3, Leif Svalgaard wrote:
> The latest[?] version of Matplotlib cannot show a figure. I get the
> annoying error message: "Matplotlib is currently using agg, which is a
> non-GUI backend, so cannot show the figure"
> I'm us
The latest[?] version of Matplotlib cannot show a figure. I get the
annoying error message: "Matplotlib is currently using agg, which is a
non-GUI backend, so cannot show the figure"
I'm using Spyder python 3.11 on Windows 11.
What to do?
--
Leif Svalgaard
l...@leif.org
On 2024-02-03 23:02, gelukt gelukt via Python-list wrote:
Dear,
While running a code, I get the error below:
What does this error mean? How can I fix this error?
C:\Users\brech\Desktop\Crypto\venv\Scripts\python.exe
"C:/Users/brech/Desktop/Crypto/Project/aaa Arbitrage.py"
Trace
Dear,
While running a code, I get the error below:
What does this error mean? How can I fix this error?
C:\Users\brech\Desktop\Crypto\venv\Scripts\python.exe
"C:/Users/brech/Desktop/Crypto/Project/aaa Arbitrage.py"
Traceback (most recent call last):
File "C:\Users\brech\Desktop
On 2023-10-30 19:19, McDermott Family via Python-list wrote:
Hello, I am trying to create a one file executable with pyinstaller 6.1.0
and auto-py-to-exe 2.41.0 using Python version 3.10.9 in a virtual
environment.
Some points before the output of pinstaller is shown. My resource .py file
is
This isn't an error.
This is just a normal Python Header message announcing that you are
using Python 3.11.3
The rest is just information from the build system : The build Id, the
date/time the build was made, and the version of the compiler.
There is nothing to fix.
-- Original
On 27/09/23 3:30 pm, Chris Roy-Smith wrote:
surely running a 64 bit version of python in a 23mbit version of windows
will cause significant problems!
23 millibits? I don't think you'd be able to run much at all
with that few bits! :-)
--
Greg
--
On 2023-09-27 03:30, Chris Roy-Smith via Python-list wrote:
On 26/9/23 22:27, Abdelkhelk ashref salay eabakh via Python-list wrote:
Dear Python team,
This is my not first time using Python, I tried to launch Python and it showed
I'm no expert but
"Python 3.11.3 (tags/v3.11.3:f3909b8,
On 26/9/23 22:27, Abdelkhelk ashref salay eabakh via Python-list wrote:
Dear Python team,
This is my not first time using Python, I tried to launch Python and it showed
I'm no expert but
"Python 3.11.3 (tags/v3.11.3:f3909b8, Apr 4 2023, 23:49:59) [MSC v.1934 64 bit
(AMD64)] on win
copyright", "credits" or "license" for more information." I
don't know what this meant and how to fix this. Could you please help me?
What error did you encounter? Aside from the lack of line breaks, it looks
quite similar to what I get when I start up python:
Python
Dear Python team,
This is my not first time using Python, I tried to launch Python and it showed
"Python 3.11.3 (tags/v3.11.3:f3909b8, Apr 4 2023, 23:49:59) [MSC v.1934 64 bit
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information." I
don't know what this meant
On Sun, Aug 27, 2023, at 17:19, Rob Cliffe via Python-list wrote:
> I understand that this is an error: I'm telling the f-string to expect
> an integer when in fact I'm giving it a Decimal.
> And indeed f"{x:3}" gives ' 42' whether x is an int or a Decimal.
&g
I am currently using Python 3.11.4.
First I want to say: f-strings are great! I use them all the time,
mostly but by no means exclusively for debug messages. And in 3.12 they
will get even better.
And the improved error messages in Python (since 3.9) are great too!
Keep up the good work
When i try to open a python script it either says theres no ctk module or
no pip
On Sun, Aug 6, 2023, 3:51 PM Peter J. Holzer via Python-list <
python-list@python.org> wrote:
> Mostly, error messages got a lot better in Python 3.10, but this one had
> me scratching my head for a
On 07Aug2023 08:02, Barry wrote:
On 7 Aug 2023, at 05:28, Cameron Simpson via Python-list
wrote:
Used to use a Pascal compiler once which was uncannily good at
suggesting where you'd missing a semicolon.
Was that on DEC VMS? It was a goal at DEC for its compilers to do this well.
No, a
> On 7 Aug 2023, at 05:28, Cameron Simpson via Python-list
> wrote:
>
> Used to use a Pascal compiler once which was uncannily good at suggesting
> where you'd missing a semicolon.
Was that on DEC VMS? It was a goal at DEC for its compilers to do this well.
They could output the errors in
On 06Aug2023 22:41, Peter J. Holzer wrote:
Mostly, error messages got a lot better in Python 3.10, but this one had
me scratching my head for a few minutes.
Consider this useless and faulty script:
r = {
"x&quo
On 07/08/2023 08.41, Peter J. Holzer via Python-list wrote:
Mostly, error messages got a lot better in Python 3.10, but this one had
me scratching my head for a few minutes.
...
The error message is now a lot better, of course, but the fact that it
points at the expression *before* the error
Mostly, error messages got a lot better in Python 3.10, but this one had
me scratching my head for a few minutes.
Consider this useless and faulty script:
r = {
"x": (1 + 2 + 3)
"y": (4 + 5 + 6)
On 5/26/2023 8:30 PM, giuseppacef...@gmail.com wrote:
I have reinstalled python which reinstalls pip. I have added the
path:'C:\sers\Giuseppa\AppData\Local\Packages\PythonSoftwareFoundation.Pytho
n.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\Scripts and still
get the error below
On 2023-05-27 01:30, giuseppacef...@gmail.com wrote:
I have reinstalled python which reinstalls pip. I have added the
path:'C:\sers\Giuseppa\AppData\Local\Packages\PythonSoftwareFoundation.Pytho
n.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\Scripts and still
get the error below
: giuseppacef...@gmail.com
Sent: Friday, May 26, 2023 8:31 PM
To: python-list@python.org
Subject: Module error
I have reinstalled python which reinstalls pip. I have added the
path:'C:\sers\Giuseppa\AppData\Local\Packages\PythonSoftwareFoundation.Pytho
n.3.11_qbz5n2kfra8p0\LocalCache\local-packages
Dir(s) 378,485,805,056 bytes free
From: giuseppacef...@gmail.com
Sent: Friday, May 26, 2023 8:31 PM
To: python-list@python.org
Subject: Module error
I have reinstalled python which reinstalls pip. I have added the
path:'C:\sers\Giuseppa\AppData\Local\Packages\PythonSoftwareFoundation.Pytho
I have reinstalled python which reinstalls pip. I have added the
path:'C:\sers\Giuseppa\AppData\Local\Packages\PythonSoftwareFoundation.Pytho
n.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\Scripts and still
get the error below. Could you help me with this please?
Traceback (most
lly
quick try shows several hits, including some StackOverflow articles.
There's no way for us to judge if any of those scenarios actually would
apply to your case, so suggesting you take a look first.
the error I get when I try to upgrade or install a package for example
pip install requests
I
Hi there, I hope you are in a great health
I am having a problem with python even though I uninstall and reinstall it
again multiple times
the error I get when I try to upgrade or install a package for example
pip install requests
I get this error which I could not find a solution for
pip
= PyUnicode_AsEncodedString(str_value, "utf-8",
"Error ~");
const char *strErrValue = PyBytes_AS_STRING(pyExcValueStr);
//where strErrValue = "ImportError('Error: Reinit is forbidden')"
...
}
What we imported is a Python file which import some pyd librari
Hi Barry,
void handleError(const char* msg)
{
...
PyErr_Fetch(, , );
PyErr_NormalizeException(, , );
PyObject* str_value = PyObject_Repr(pyExcValue);
PyObject* pyExcValueStr = PyUnicode_AsEncodedString(str_value, "utf-8",
"Error ~");
const char **strErrValue* = PyBytes_AS_
> On 17 May 2023, at 20:35, Jason Qian via Python-list
> wrote:
>
> Hi,
>
> I Need some of your help.
>
> I have the following C code to import *Import python.* It works 99% of
> the time, but sometimes receives "*ImportError('Error: Reinit is
&g
Hi,
I Need some of your help.
I have the following C code to import *Import python.* It works 99% of
the time, but sometimes receives "*ImportError('Error: Reinit is
forbidden')*". error.
**We run multiple instances of the app parallelly.
*** Python version(3.7.0 (v3.7.0:
On 5/17/2023 10:54 AM, Aysu Mammadli wrote:
I encountered an error while attempting to install pip using the terminal.
The exact error message I received is:
"An error occurred during configuration: option use-feature: invalid
choice: '2020-resolver' (choose from 'fast-deps', 'trust
> On 17 May 2023, at 17:26, Aysu Mammadli wrote:
>
> I encountered an error while attempting to install pip using the terminal.
> The exact error message I received is:
>
> "An error occurred during configuration: option use-feature: invalid
> choice: '2020-resolve
I encountered an error while attempting to install pip using the terminal.
The exact error message I received is:
"An error occurred during configuration: option use-feature: invalid
choice: '2020-resolver' (choose from 'fast-deps', 'truststore',
'no-binary-enable-wheel-cache')&q
open('file.pkl', 'rb') as file:
number=pickle.load(file)
my_unpickeled_object=pickle.loads(my_pickeld_object)
print("this is my unpickeled object",{my_unpickeled_object},)
but now i get error
Traceback (most recent call last):
File "C:\Users\lukwi\Desktop\python\tester2.py", li
3 at 04:55:41 PM, Chris Green wrote:
> > > > > I'm sure I'm missing something obvious here but I can't see an
> elegant
> > > > > way to do this. I want to create a directory, but if it exists
> it's
> > > > > not an error and the code sh
be I only say this because it has happened to me too many times but
> before ignoring the error in the 'except' branch, I would make sure that
> if the name exists it is a folder and not a file.
>
That's a fair consideration, although the other way to handle that is
to allow other operation
Stefan Ram ha scritto:
jak writes:
Maybe I only say this because it has happened to me too many times but
before ignoring the error in the 'except' branch, I would make sure that
if the name exists it is a folder and not a file.
If the name exists and it is a file's name
t I can't see an elegant
> > > > way to do this. I want to create a directory, but if it exists it's
> > > > not an error and the code should just continue.
> > > >
> > > > So, I have:-
> > > >
> > > > for dirnam
Chris Angelico ha scritto:
Using mkdirs when you only want to make one is inviting problems of
being subtly wrong, where it creates too many levels of directory.
Personally, I would just do:
Maybe I only say this because it has happened to me too many times but
before ignoring the error
Kushal Kumaran wrote:
> On Fri, Apr 28 2023 at 04:55:41 PM, Chris Green wrote:
> > I'm sure I'm missing something obvious here but I can't see an elegant
> > way to do this. I want to create a directory, but if it exists it's
> > not an error and the code should just co
directory, but if it exists it's
> > > not an error and the code should just continue.
> > >
> > > So, I have:-
> > >
> > > for dirname in listofdirs:
> > > try:
> > > os.mkdir(dirname)
> > >
On 30/04/23 2:43 am, jak wrote:
Maybe I expressed myself badly but I didn't mean to propose alternatives
to the EAFP way but just to evaluate the possibility that it is not a
folder.
If it's not a folder, you'll find out when the next thing you
try to do to it fails.
You could check for it
require a loss of simplicity.
-Original Message-
From: Python-list On
Behalf Of Kushal Kumaran
Sent: Saturday, April 29, 2023 12:19 AM
To: python-list@python.org
Subject: Re: How to 'ignore' an error in Python?
On Fri, Apr 28 2023 at 04:55:41 PM, Chris Green wrote:
> I'm sure
On Sat, 29 Apr 2023 at 14:27, Kushal Kumaran wrote:
>
> On Fri, Apr 28 2023 at 04:55:41 PM, Chris Green wrote:
> > I'm sure I'm missing something obvious here but I can't see an elegant
> > way to do this. I want to create a directory, but if it exists it's
> > not an e
On Fri, Apr 28 2023 at 04:55:41 PM, Chris Green wrote:
> I'm sure I'm missing something obvious here but I can't see an elegant
> way to do this. I want to create a directory, but if it exists it's
> not an error and the code should just continue.
>
> So, I have:-
>
On 28Apr2023 10:39, Mats Wichmann wrote:
For this specific case, you can use os.makedirs:
os.makedirs(dirname, exist_ok=True)
I'm not a great fan of makedirs because it will make all the missing
components, not just the final one. So as an example, if you've got a
NAS mounted backup area at
On 28Apr2023 16:55, Chris Green wrote:
for dirname in listofdirs:
try:
os.mkdir(dirname)
except FileExistsError:
# so what can I do here that says 'carry on regardless'
except:
# handle any other error, which is really an error
On 4/28/23 11:05, MRAB wrote:
On 2023-04-28 16:55, Chris Green wrote:
I'm sure I'm missing something obvious here but I can't see an elegant
way to do this. I want to create a directory, but if it exists it's
not an error and the code should just continue.
So, I have:-
for dirname
On 2023-04-28 16:55, Chris Green wrote:
I'm sure I'm missing something obvious here but I can't see an elegant
way to do this. I want to create a directory, but if it exists it's
not an error and the code should just continue.
So, I have:-
for dirname in listofdirs:
try
On 4/28/23 09:55, Chris Green wrote:
I'm sure I'm missing something obvious here but I can't see an elegant
way to do this. I want to create a directory, but if it exists it's
not an error and the code should just continue.
So, I have:-
for dirname in listofdirs:
try
I'm sure I'm missing something obvious here but I can't see an elegant
way to do this. I want to create a directory, but if it exists it's
not an error and the code should just continue.
So, I have:-
for dirname in listofdirs:
try:
os.mkdir(dirname)
except
') as file:
number=pickle.load(file)
my_unpickeled_object=pickle.loads(my_pickeld_object)
print("this is my unpickeled object",{my_unpickeled_object},)
but now i get error
Traceback (most recent call last):
File "C:\Users\lukwi\Desktop\python\tester2.py", line 5, in
.load(file)
my_unpickeled_object=pickle.loads(my_pickeld_object)
print("this is my unpickeled object",{my_unpickeled_object},)
but now i get error
Traceback (most recent call last):
File "C:\Users\lukwi\Desktop\python\tester2.py", line 5, in
with open('file.pkl', 'rb') as file:
FileNotFoun
When I using pip list, it tells me there is a new release of pip is available,
but I got these error messages when I upgrading pip. I don’t know what happened
it is.
PS C:\Users\USER> pip --version pip
pip 23.0.1 from
C:\Users\USER\AppData\Roaming\Python\Python310\site-packages\pip (pyt
On Tue, 7 Mar 2023 at 16:53, Stephen Tucker wrote:
>
> Hi again,
>
> I tried xrange, but I got an error telling me that my integer was too big
> for a C long.
>
> Clearly, xrange in Py2 is not capable of dealing with Python (that is,
> possibly very long) integers.
Th
Hi again,
I tried xrange, but I got an error telling me that my integer was too big
for a C long.
Clearly, xrange in Py2 is not capable of dealing with Python (that is,
possibly very long) integers.
I am raising this because,
(a) IF xrange in Py3 is a simple "port" from Py2, the
On 2023-03-02, Stephen Tucker wrote:
> The range function in Python 2.7 (and yes, I know that it is now
> superseded), provokes a Memory Error when asked to deiliver a very long
> list of values.
>
> I assume that this is because the function produces a list which it then
>
On Thu, 2 Mar 2023 at 22:27, Stephen Tucker wrote:
>
> Hi,
>
> The range function in Python 2.7 (and yes, I know that it is now
> superseded), provokes a Memory Error when asked to deiliver a very long
> list of values.
>
> I assume that this is because the functi
On 2023-03-02 at 11:25:49 +,
Stephen Tucker wrote:
> The range function in Python 2.7 (and yes, I know that it is now
> superseded), provokes a Memory Error when asked to deiliver a very long
> list of values.
>
> I assume that this is because the function produc
Hi,
The range function in Python 2.7 (and yes, I know that it is now
superseded), provokes a Memory Error when asked to deiliver a very long
list of values.
I assume that this is because the function produces a list which it then
iterates through.
1. Does the range function in Python 3.x
of Peter J. Holzer
Date: Saturday, February 25, 2023 at 5:21 PM
To: python-list@python.org
Subject: Re: Why doesn't Python (error msg) tell me WHAT the actual (arg)
values are ?
On 2023-02-25 21:58:18 +, Weatherby,Gerard wrote:
> I only use asserts for things I know to be true.
Yeah, tha
On 2023-02-25 21:58:18 +, Weatherby,Gerard wrote:
> I only use asserts for things I know to be true.
Yeah, that's what assers are for. Or rather for things that you *think*
are true.
> In other words, a failing assert means I have a hole in my program
> logic.
Yes, if you include your
, February 25, 2023 at 9:22 AM
To: python-list@python.org
Subject: Re: Why doesn't Python (error msg) tell me WHAT the actual (arg)
values are ?
On 2023-02-25 09:10:06 -0500, Thomas Passin wrote:
> On 2/25/2023 1:13 AM, Peter J. Holzer wrote:
> > On 2023-02-24 18:19:52 -0500, Thomas Pas
On 2023-02-25 09:10:06 -0500, Thomas Passin wrote:
> On 2/25/2023 1:13 AM, Peter J. Holzer wrote:
> > On 2023-02-24 18:19:52 -0500, Thomas Passin wrote:
> > > Sometimes you can use a second parameter to assert if you know what kind
> > > of
> > > error to
appropriate.
Curiously, this does not even occur during an assert exception -
despite the value/relationship being the whole point of using
the command!
x = 1
assert x == 2
AssertionError (and that's it)
Sometimes you can use a second parameter to assert if you know what kind of
error
t x == 2
> > > >
> > > > AssertionError (and that's it)
>
> Sometimes you can use a second parameter to assert if you know what kind of
> error to expect:
>
> >>> a = [1,2,3]
> >>> b = [4,5]
> >>> assert len(a) == len(b), f'len
/relationship being the whole point of using the command!
x = 1
assert x == 2
AssertionError (and that's it)
Sometimes you can use a second parameter to assert if you know what kind
of error to expect:
>>> a = [1,2,3]
>>> b = [4,5]
>>> assert len(a) == len(b)
On 2023-02-25 08:47:00 +1300, dn via Python-list wrote:
> That said, have observed coders 'graduating' from other languages, making
> wider use of assert - assumed to be more data (value) sanity-checks than
> typing, but ...
>
> Do you use assert frequently?
Not very often, but I do use it.
plaining that Python does not
work the way it 'should'. In turn, gives rise to the impression that
expounding the advantages of TDD, and thus anticipating such unit and
integration error-possibilities, might be considered an insult or unhelpful.
(sigh!)
Personally, I struggled a bit to adapt from
On 2023-02-24 16:12:10 +1300, dn via Python-list wrote:
> In some ways, providing this information seems appropriate. Curiously, this
> does not even occur during an assert exception - despite the
> value/relationship being the whole point of using the command!
>
> x = 1
> assert x == 2
>
On 2023-02-23 20:32:26 -0700, Michael Torrie wrote:
> 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
r: can only concatenate str (not "int") to str
> >
> >
> > Why doesn't Python (error msg) do the obvious thing and tell me
> > WHAT the actual (offending, arg) values are ?
> >
> > In many cases, it'd help to know what string the var A had , when t
1 - 100 of 24848 matches
Mail list logo