Dynamic classes

2025-05-19 Thread Jonathan Gossage via Python-list
er, when I try to create an instance of this class with the following code: y = x('Flag1', 'Flag2') it fails with a TypeError stating that 'MyFlags' does not accept arguments. What do I have to do to make this happen?. BTW __init__(self, *args) is defined as the instance

Pip installs to unexpected place

2025-04-13 Thread Jonathan Gossage via Python-list
install* command. Is this expected behavior? I wanted Sphinx to be installed in the virtual environment so that it would be accessible to all users of the virtual environment. -- Jonathan Gossage -- https://mail.python.org/mailman/listinfo/python-list

Using __new__

2024-02-17 Thread Jonathan Gossage via Python-list
) I am quite puzzled as it looks as if this code will not work if the super-class is 'object'. Any suggestions on how to proceed? -- Jonathan Gossage -- https://mail.python.org/mailman/listinfo/python-list

Re: Using generator expressions

2023-09-25 Thread Jonathan Gossage via Python-list
Mon, Sep 25, 2023 at 11:15 AM Thomas Passin via Python-list < python-list@python.org> wrote: > On 9/25/2023 10:15 AM, Jonathan Gossage via Python-list wrote: > > I am having a problem using generator expressions to supply the arguments > > for a class instance initialization.

Using generator expressions

2023-09-25 Thread Jonathan Gossage via Python-list
hat I tried generator expressions both inside parentheses and not, without success. -- Jonathan Gossage -- https://mail.python.org/mailman/listinfo/python-list

Forward References

2023-09-03 Thread Jonathan Gossage via Python-list
: TypeAlias = RGB | int | str @dataclass(frozen=True, slots=True) class RGB(object): Can anyone suggest how I should fix this without reversing the statement order? pass -- Jonathan Gossage -- https://mail.python.org/mailman/listinfo/python-list

Using PIP in Python 3.10 on Windows 10

2022-01-14 Thread Jonathan Gossage
thon installed at c:\Program Files\Python3.10 whereas it has actually been installed at D:\Users\jgoss\AppData\local\python\python3.10. It seems that the launcher has not been updated to the latest installation location for python and that it also needs to handle a non-default install location. The

Typing modules

2020-07-20 Thread Jonathan Gossage
I have the following code and I would like to type the variable *contents*: contents: something = importlib._import_module(name) I have been unable to find out what *something* should be. -- Jonathan Gossage -- https://mail.python.org/mailman/listinfo/python-list

Function type in typing

2020-07-08 Thread Jonathan Gossage
. -- Jonathan Gossage -- https://mail.python.org/mailman/listinfo/python-list

Asynchronous generators

2020-06-23 Thread Jonathan Gossage
-- I am attempting to learn how to use asyncio and I have been unable to find any documentation or Internet posts that give information on the principles underlying asyncio, let alone any examples showing how asynchronous generators should be used. I have built a toy program to test trying to read

Re: Validating Command Line Options

2011-03-23 Thread Jonathan Gossage
See inline comments On Wed, Mar 23, 2011 at 2:13 PM, Alex Willmer wrote: > On Mar 23, 3:20 pm, T wrote: > > Thanks! argparse is definitely what I need..unfortunately I'm running > > 2.6 now, so I'll need to upgrade to 2.7 and hope that none of my other > > scripts break. > > Argparse was a thi

Re: PEP for module naming conventions

2011-03-17 Thread Jonathan Gossage
I have found this approach problematic if you have packages separately developed and maintained in different directory trees, resulting in more than one PYTHONPATH entry with the same root metapackage name. What happens is that only the first entry in the PYTHONPATH containing the metapackage name