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

2021-08-03 Thread Sean DiZazzo
On Tuesday, August 3, 2021 at 3:04:19 AM UTC-7, Bartosz Golaszewski wrote: > On Sat, Jul 31, 2021 at 3:01 PM Bartosz Golaszewski wrote: > > > > On Fri, Jul 30, 2021 at 2:41 PM Serhiy Storchaka wrote: > > > > > > 23.07.21 11:20, Bartosz Golaszewski пише: > > > > I'm working on a Python C exte

Re: SQLALchemy: update with in clause from kwargs

2021-08-03 Thread dn via Python-list
On 04/08/2021 13.08, Larry Martell wrote: > I am trying to write a function that takes kwargs as a param and > generates an update statement where the rows to be updated are > specified in an in clause. > > Something like this: > > def update_by_in(self, **kwargs): > filter_group = []

Re: SQLALchemy: update with in clause from kwargs

2021-08-03 Thread MRAB
On 2021-08-04 02:08, Larry Martell wrote: I am trying to write a function that takes kwargs as a param and generates an update statement where the rows to be updated are specified in an in clause. Something like this: def update_by_in(self, **kwargs): filter_group = [] fo

SQLALchemy: update with in clause from kwargs

2021-08-03 Thread Larry Martell
I am trying to write a function that takes kwargs as a param and generates an update statement where the rows to be updated are specified in an in clause. Something like this: def update_by_in(self, **kwargs): filter_group = [] for col in kwargs['query_params']: #

Re: argparse: delimiter for argparse list arguments

2021-08-03 Thread Roel Schroeven
Jon Ribbens via Python-list schreef op 3/08/2021 om 22:55: >> Loads of git commands do this. e.g. commit, diff, log, status, etc. >> It's not completely unlike what you're describing above, which is >> already supported automatically by argparse. > > Commands like git commit do not use '--' to se

Re: argparse: delimiter for argparse list arguments

2021-08-03 Thread Jon Ribbens via Python-list
On 2021-08-03, Roel Schroeven wrote: > Jon Ribbens via Python-list schreef op 3/08/2021 om 17:48: >> On 2021-08-03, Michael Torrie wrote: >> > On 8/2/21 1:43 PM, Sven R. Kunze wrote: >> >> maybe, I am missing something here but is it possible to specify a >> >> delimiter for list arguments in ar

Re: argparse: delimiter for argparse list arguments

2021-08-03 Thread Chris Angelico
On Wed, Aug 4, 2021 at 7:07 AM Sven R. Kunze wrote: > > It could be but I've seen them used somewhere else. > > I wouldn't bikeshed on this yet, as I haven't found a way to do this so > far. Let's imagine the following parser: > > parser.add_argument('things',action='append') > parser.add_argument

Re: argparse: delimiter for argparse list arguments

2021-08-03 Thread Sven R. Kunze
It could be but I've seen them used somewhere else. I wouldn't bikeshed on this yet, as I haven't found a way to do this so far. Let's imagine the following parser: parser.add_argument('things',action='append') parser.add_argument('stuff',action='append') At least from my point of view, I don

Re: argparse: delimiter for argparse list arguments

2021-08-03 Thread Roel Schroeven
Jon Ribbens via Python-list schreef op 3/08/2021 om 17:48: On 2021-08-03, Michael Torrie wrote: > On 8/2/21 1:43 PM, Sven R. Kunze wrote: >> maybe, I am missing something here but is it possible to specify a >> delimiter for list arguments in argparse: >> >> https://docs.python.org/3/library/a

Re: argparse: delimiter for argparse list arguments

2021-08-03 Thread Jon Ribbens via Python-list
On 2021-08-03, Michael Torrie wrote: > On 8/2/21 1:43 PM, Sven R. Kunze wrote: >> maybe, I am missing something here but is it possible to specify a >> delimiter for list arguments in argparse: >> >> https://docs.python.org/3/library/argparse.html >> >> Usually, '--' is used to separate two lis

[RELEASE] Python 3.10.0rc1 is available

2021-08-03 Thread Pablo Galindo Salgado
Python 3.10.0 is almost ready. This release, 3.10.0rc1, is the penultimate release preview. You can get it here: https://www.python.org/downloads/release/python-3100rc1/ *This is the first release candidate of Python 3.10* This release, **3.10.0rc1**, is the penultimate release preview. Enterin

Re: argparse: delimiter for argparse list arguments

2021-08-03 Thread Michael Torrie
On 8/2/21 1:43 PM, Sven R. Kunze wrote: > Hi everyone, > > maybe, I am missing something here but is it possible to specify a > delimiter for list arguments in argparse: > > https://docs.python.org/3/library/argparse.html > > Usually, '--' is used to separate two lists (cf. git). I've not seen

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

2021-08-03 Thread Bartosz Golaszewski
On Sat, Jul 31, 2021 at 3:01 PM Bartosz Golaszewski wrote: > > On Fri, Jul 30, 2021 at 2:41 PM Serhiy Storchaka wrote: > > > > 23.07.21 11:20, Bartosz Golaszewski пише: > > > I'm working on a Python C extension and I would like to expose a > > > custom enum (as in: a class inheriting from enum.En