Re: Defining a Python enum in a C extension - am I doing this right?

2021-07-23 Thread Dan Stromberg
On Fri, Jul 23, 2021 at 1:20 AM Bartosz Golaszewski wrote: > Hi! > > I'm working on a Python C extension and I would like to expose a > custom enum (as in: a class inheriting from enum.Enum) that would be > entirely defined in C. > I'm probably missing something obvious, but why would you write

Re: Python and Ubuntu versions

2021-07-23 Thread Chris Angelico
On Sat, Jul 24, 2021 at 9:52 AM Cameron Simpson wrote: > > On 24Jul2021 09:22, Chris Angelico wrote: > >On Sat, Jul 24, 2021 at 9:03 AM Cameron Simpson wrote: > >> Rereading this, maybe I was unclear. This is for install directories > >> like /opt/Python-3.whatever or /usr/local/python-3.whateve

Re: Python and Ubuntu versions

2021-07-23 Thread Cameron Simpson
On 24Jul2021 09:22, Chris Angelico wrote: >On Sat, Jul 24, 2021 at 9:03 AM Cameron Simpson wrote: >> Rereading this, maybe I was unclear. This is for install directories >> like /opt/Python-3.whatever or /usr/local/python-3.whatever. Create the >> install point, chown, install as yourself. >> >>

Re: Python and Ubuntu versions

2021-07-23 Thread Chris Angelico
On Sat, Jul 24, 2021 at 9:03 AM Cameron Simpson wrote: > > On 23Jul2021 19:51, Chris Angelico wrote: > >On Fri, Jul 23, 2021 at 7:48 PM Cameron Simpson wrote: > >> Do the build and install as yourself. I usually do the install step by > >> making the install directory as root, then chowning it t

Re: Where to keep local Python modules?

2021-07-23 Thread Cameron Simpson
On 23Jul2021 11:33, Chris Green wrote: >This isn't a question about how to set PYTHONPATH so that Python code >can find imported modules, it's about what is a sensible layout for >one's home directory - i.e. where to put Python modules. > >I'm running Linux and have a number of Python modules that

Re: Python and Ubuntu versions

2021-07-23 Thread Cameron Simpson
On 23Jul2021 19:51, Chris Angelico wrote: >On Fri, Jul 23, 2021 at 7:48 PM Cameron Simpson wrote: >> Do the build and install as yourself. I usually do the install step by >> making the install directory as root, then chowning it to me. Then you >> can do the install as you - this has the advanta

Re: Where to keep local Python modules?

2021-07-23 Thread Chris Green
Roland Mueller wrote: > Hello, > > pe 23. heinäk. 2021 klo 21.44 Chris Green (c...@isbd.net) kirjoitti: > > > This isn't a question about how to set PYTHONPATH so that Python code > > can find imported modules, it's about what is a sensible layout for > > one's home directory - i.e. where to put

Re: Python and Ubuntu versions

2021-07-23 Thread Terry Reedy
On 7/23/2021 12:54 AM, אורי wrote: Hi, I have a production server with Ubuntu 18.04 LTS (currently upgraded to Ubuntu 18.04.5 LTS) and I use Python in virtualenv - currently Python 3.6.9. I'm using Django and I read that from Django 4.0, a minimal version of Python 3.8 will be required. I would

Re: Where to keep local Python modules?

2021-07-23 Thread Paul Bryan
On my Arch Linux box, slightly different path, but still in .local/bin: pbryan@dynamo:~$ python3 Python 3.9.6 (default, Jun 30 2021, 10:22:16) [GCC 11.1.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path ['', '/usr/lib/python39.zip', '/u

Re: Where to keep local Python modules?

2021-07-23 Thread Roland Mueller via Python-list
Hello, pe 23. heinäk. 2021 klo 21.44 Chris Green (c...@isbd.net) kirjoitti: > This isn't a question about how to set PYTHONPATH so that Python code > can find imported modules, it's about what is a sensible layout for > one's home directory - i.e. where to put Python modules. > > I'm running Linu

Where to keep local Python modules?

2021-07-23 Thread Chris Green
This isn't a question about how to set PYTHONPATH so that Python code can find imported modules, it's about what is a sensible layout for one's home directory - i.e. where to put Python modules. I'm running Linux and have a number of Python modules that are only used by my own code. My top level

a clean exit

2021-07-23 Thread jak
Hello everybody, I wrote a bot for telegram which consists of some processes of which the main ones are: - the main process: a list of callback functions - a second process: managed with a message queue - a third process: started by the library I use (python-telegram-bot) which is used for the eve

Re: Defining a Python enum in a C extension - am I doing this right?

2021-07-23 Thread Bartosz Golaszewski
On Fri, Jul 23, 2021 at 5:08 PM MRAB wrote: > > On 2021-07-23 09:20, Bartosz Golaszewski wrote: > > Hi! > > > > I'm working on a Python C extension and I would like to expose a > > custom enum (as in: a class inheriting from enum.Enum) that would be > > entirely defined in C. > > > > It turned out

Re: Defining a Python enum in a C extension - am I doing this right?

2021-07-23 Thread MRAB
On 2021-07-23 09:20, Bartosz Golaszewski wrote: Hi! I'm working on a Python C extension and I would like to expose a custom enum (as in: a class inheriting from enum.Enum) that would be entirely defined in C. It turned out to not be a trivial task and the regular mechanism for inheritance using

Re: Python and Ubuntu versions

2021-07-23 Thread Chris Angelico
On Fri, Jul 23, 2021 at 7:48 PM Cameron Simpson wrote: > Do the build and install as yourself. I usually do the install step by > making the install directory as root, then chowning it to me. Then you > can do the install as you - this has the advantage the you're > unprivileged and can't accident

Re: Python and Ubuntu versions

2021-07-23 Thread Cameron Simpson
On 23Jul2021 07:54, אורי wrote: >I have a production server with Ubuntu 18.04 LTS (currently upgraded to >Ubuntu 18.04.5 LTS) and I use Python in virtualenv - currently Python >3.6.9. I'm using Django and I read that from Django 4.0, a minimal version >of Python 3.8 will be required. I would like

Defining a Python enum in a C extension - am I doing this right?

2021-07-23 Thread Bartosz Golaszewski
Hi! I'm working on a Python C extension and I would like to expose a custom enum (as in: a class inheriting from enum.Enum) that would be entirely defined in C. It turned out to not be a trivial task and the regular mechanism for inheritance using .tp_base doesn't work - most likely due to the En

Re: argparse support of/by argparse

2021-07-23 Thread Chris Angelico
On Fri, Jul 23, 2021 at 5:34 PM Albert-Jan Roskam wrote: > > >>> [1] https://pypi.org/project/clize/ > > > I use and like docopt (https://github.com/docopt/docopt). Is clize a better > choice? > Not necessarily. Both are good. Explore both, see which one makes more sense. ChrisA -- https://mai

Re: Python and Ubuntu versions

2021-07-23 Thread Chris Angelico
‪On Fri, Jul 23, 2021 at 2:55 PM ‫אורי‬‎ wrote:‬ > > Hi, > > I have a production server with Ubuntu 18.04 LTS (currently upgraded to > Ubuntu 18.04.5 LTS) and I use Python in virtualenv - currently Python > 3.6.9. I'm using Django and I read that from Django 4.0, a minimal version > of Python 3.8

Re: argparse support of/by argparse

2021-07-23 Thread Albert-Jan Roskam
>>> [1] https://pypi.org/project/clize/ I use and like docopt (https://github.com/docopt/docopt). Is clize a better choice? -- https://mail.python.org/mailman/listinfo/python-list