Re: Why do I always get an exception raised in this __init__()?

2023-08-31 Thread Larry Martell via Python-list
On Thu, Aug 31, 2023 at 3:19 PM Chris Green via Python-list wrote: > > I'm obviously doing something very silly here but at the moment I > can't see what. > > Here's the code:- > > #!/usr/bin/python3 > # > # > # GPIO > # > import gpiod > # > # > # Simple

Why do I always get an exception raised in this __init__()?

2023-08-31 Thread Chris Green via Python-list
I'm obviously doing something very silly here but at the moment I can't see what. Here's the code:- #!/usr/bin/python3 # # # GPIO # import gpiod # # # Simple wrapper class for gpiod to make set and clearing outputs easier # class Gpiopin:

Re: Why do I always get an exception raised in this __init__()?

2023-08-31 Thread Chris Green via Python-list
Chris Green wrote: [snip code and question] Sorry folks, it was a caching problem, I wasn't running the code I thought I was running! When I made sure I had cleared everything out and tried again it all worked as I expected. -- Chris Green · --

Re: What sort of exception when a class can't find something?

2023-08-31 Thread Chris Green via Python-list
Several helpful replies, thank you all. -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: What sort of exception when a class can't find something?

2023-08-31 Thread Chris Angelico via Python-list
On Fri, 1 Sept 2023 at 06:39, Chris Green via Python-list wrote: > > What sort of exception should a class raise in __init__() when it > can't find an appropriate set of data for the parameter passed in to > the class instantiation? > > E.g. I have a database with some names and address in and

Re: What sort of exception when a class can't find something?

2023-08-31 Thread Peter J. Holzer via Python-list
On 2023-08-31 21:32:04 +0100, Chris Green via Python-list wrote: > What sort of exception should a class raise in __init__() when it > can't find an appropriate set of data for the parameter passed in to > the class instantiation? > > E.g. I have a database with some names and address in and have

What sort of exception when a class can't find something?

2023-08-31 Thread Chris Green via Python-list
What sort of exception should a class raise in __init__() when it can't find an appropriate set of data for the parameter passed in to the class instantiation? E.g. I have a database with some names and address in and have a class Person that gets all the details for a person given their name.