Back around 2000 I needed to learn Java for work. I bought a book and started in. Of course the first program is a Hello World (it's mandatory ever since K&R). I typed the code in and it wouldn't compile. Unfortunately, the book didn't clue me in that in Java, the name of the file must be the same as the name of the class. I had put my HelloWorld class in a file named program1.java.
Not the first or last forehead slap. On Fri, Sep 2, 2022 at 4:43 PM Martin Blais <[email protected]> wrote: > I think running pylint on the code may have helped, but I'm not sure if it > would have caught your name attribute override. > > > On Fri, Sep 2, 2022 at 3:21 PM Bruce Berkowicz <[email protected]> > wrote: > >> Thank you, thank you, thank you! It now works. >> Wow, I would have never found that on my own. >> >> Copy/pasting python code into this message - I do not know how to >> preserve the indentation. >> >> Bruce >> >> On Fri, Sep 2, 2022 at 3:00 PM Daniele Nicolodi <[email protected]> >> wrote: >> >>> On 02/09/2022 20:49, Bruce Berkowicz wrote: >>> > Hello, >>> > Thanks for helping. >>> > I left out code that I thought was unimportant. >>> > My class does have a name function that returns the name of the >>> importer. >>> > So I am not sure why importer.name() is failing. >>> > >>> > My class is actually this: >>> >>> The code below has no indentation. I think something went wrong... >>> >>> > class ChaseBankImporter(importer.ImporterProtocol): >>> > def __init__(self, account, name, currency='USD'): >>> > self.account = account >>> > self.name = name >>> ^^^^^^^^^^^^^^^^ >>> >>> The problem is here, this overrides the ``name()`` method with a >>> ``name`` instance property. >>> >>> Cheers, >>> Dan >>> >>> -- >>> You received this message because you are subscribed to a topic in the >>> Google Groups "Beancount" group. >>> To unsubscribe from this topic, visit >>> https://groups.google.com/d/topic/beancount/N5fCig2YZck/unsubscribe. >>> To unsubscribe from this group and all its topics, send an email to >>> [email protected]. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/beancount/69aa2745-2658-20b0-4546-e7448b2af536%40grinta.net >>> . >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "Beancount" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/beancount/CAAtie6arL-Rz0Pgk2OBdPMBueUf5-%3D%2Bakx%3DhuN%2BWrxupQNRqtg%40mail.gmail.com >> <https://groups.google.com/d/msgid/beancount/CAAtie6arL-Rz0Pgk2OBdPMBueUf5-%3D%2Bakx%3DhuN%2BWrxupQNRqtg%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> > -- > You received this message because you are subscribed to the Google Groups > "Beancount" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/beancount/CAK21%2BhOBZVCVJrOLL7rMwnVWqTD7JkjfCbQkgkbBFi1uxKHO3A%40mail.gmail.com > <https://groups.google.com/d/msgid/beancount/CAK21%2BhOBZVCVJrOLL7rMwnVWqTD7JkjfCbQkgkbBFi1uxKHO3A%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Beancount" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/CAAtie6bvfYJibjxUkhoyLV75OVhiTx7HZOzpYtojQQfYfA3-xg%40mail.gmail.com.
