Request: inspect: signature & getfullargspec & getcallargs

2023-12-03 Thread Dom Grigonis via Python-list
Hello, I have a request. Would it be possible to include `follow_wrapper_chains` and `skip_bound_arg` arguments to higher level functions of `inspect` module? Would exposing them, but setting defaults to what they currently are, be possible? I sometimes need: * `getcallargs`, but with

Re: on writing a number as 2^s * q, where q is odd

2023-11-29 Thread Dom Grigonis via Python-list
def powers_of_2_in(n): s = 0 while n % 2 == 0: s += 1 n = n // 2 return s, n > On 30 Nov 2023, at 02:44, Julieta Shem via Python-list > wrote: > > How would you write this procedure? > > --8<---cut here---start->8--- > def powers_

Re: argparse argument post-processing

2023-11-27 Thread Dom Grigonis via Python-list
bottleneck. > On 27 Nov 2023, at 22:36, Mats Wichmann wrote: > > On 11/27/23 13:21, Dom Grigonis wrote: >> Thank you, exactly what I was looking for! >> One more question following this. Is there a way to have a customisable >> action? I.e. What if I want to join with

Re: argparse argument post-processing

2023-11-27 Thread Dom Grigonis via Python-list
ats Wichmann via Python-list > wrote: > > On 11/27/23 04:29, Dom Grigonis via Python-list wrote: >> Hi all, >> I have a situation, maybe someone can give some insight. >> Say I want to have input which is comma separated array (e.g. >> paths='path1,path2,pat

argparse argument post-processing

2023-11-27 Thread Dom Grigonis via Python-list
Hi all, I have a situation, maybe someone can give some insight. Say I want to have input which is comma separated array (e.g. paths='path1,path2,path3') and convert it to the desired output - list: import argparse parser = argparse.ArgumentParser() parser.add_argument('paths', type=lambda x: li

Re: __set_name__ equivalent for instance

2023-11-16 Thread Dom Grigonis via Python-list
Thank you. > On 16 Nov 2023, at 21:30, Dieter Maurer wrote: > > Dom Grigonis wrote at 2023-11-16 21:11 +0200: >> ... >>> On 16 Nov 2023, at 21:00, Dieter Maurer wrote: >>> ... >>> Methods are not bound during instance creation, they are bound during &g

Re: __set_name__ equivalent for instance

2023-11-16 Thread Dom Grigonis via Python-list
> On 16 Nov 2023, at 21:00, Dieter Maurer wrote: > > Dom Grigonis wrote at 2023-11-16 20:12 +0200: >> What I am interested in is a callback. >> Preferably just after methods get bound. So in `object.__new__`. > >> I have done it via metaclass, but it is not id

Re: __set_name__ equivalent for instance

2023-11-16 Thread Dom Grigonis via Python-list
ter Maurer wrote: > > Dom Grigonis wrote at 2023-11-15 18:44 +0200: >> So there is a method __set_name__ which is called on class creation. >> >> The functionality that I am interested in is not retrieving name, but the >> fact that it also receives `owner

Re: xor operator

2023-11-15 Thread Dom Grigonis via Python-list
In case someone is actually going to execute the code, there is a bug: `set` need to be wrapped in `len` for criteria args. > On 15 Nov 2023, at 20:13, Dom Grigonis wrote: > > > The specific situation was related to truth values and following out of that > my considera

__set_name__ equivalent for instance

2023-11-15 Thread Dom Grigonis via Python-list
So there is a method __set_name__ which is called on class creation. The functionality that I am interested in is not retrieving name, but the fact that it also receives `owner` argument. Thus, allowing simulation of bound class method. I was wandering if there is an equivalent functionality of

Re: xor operator

2023-11-15 Thread Dom Grigonis via Python-list
, but it seems fairly probable to need `set() > n` and `set() < n`. Regards, DG > On 15 Nov 2023, at 19:16, Peter J. Holzer via Python-list > wrote: > > On 2023-11-15 12:26:32 +0200, Dom Grigonis wrote: >> >> Thank you, >> >> >> test2 = [True]

Re: xor operator

2023-11-15 Thread Dom Grigonis via Python-list
significantly slower. Regards, DG > On 15 Nov 2023, at 02:34, Peter J. Holzer via Python-list > wrote: > > On 2023-11-14 00:11:30 +0200, Dom Grigonis via Python-list wrote: >> Benchmarks: >> test1 = [False] * 100 + [True] * 2 >> test2 = [True] * 100 + [False] * 2 >

Re: xor operator (DEPRECATED)

2023-11-13 Thread Dom Grigonis via Python-list
hon-list > wrote: > > On 11/13/2023 11:44 PM, AVI GROSS via Python-list wrote: >> Dom, >> I hear you. >> As you say, writing your own extension in something like C++ may not appeal >> to you even if it is faster. >> I was wondering if using a generator or s

Re: xor operator (DEPRECATED)

2023-11-13 Thread Dom Grigonis via Python-list
- > From: Python-list On > Behalf Of Grant Edwards via Python-list > Sent: Monday, November 13, 2023 8:19 PM > To: python-list@python.org > Subject: Re: xor operator > > On 2023-11-14, Dom Grigonis via Python-list wrote: >> >>> Except the 'any'

Re: xor operator

2023-11-13 Thread Dom Grigonis via Python-list
thing. DG > On 14 Nov 2023, at 02:33, Mats Wichmann via Python-list > wrote: > > On 11/13/23 16:24, Dom Grigonis via Python-list wrote: >> I am not arguing that it is a generalised xor. >> I don’t want anything, I am just gauging if it is specialised or if there is >

Re: xor operator

2023-11-13 Thread Dom Grigonis via Python-list
> Except the 'any' and 'all' builtins are _exactly_ the same as bitwise > or and and applided to many bits. To do something "in line" with that > using the 'xor' operator would return True for an odd number of True > values and False for an even Number of True values. Fair point. Have you ever

Re: xor operator

2023-11-13 Thread Dom Grigonis via Python-list
some time to even convey what I mean. Bad naming didn’t help ofc, but if it was something that is needed I think it would have clicked much faster. Thanks, DG > On 14 Nov 2023, at 01:12, Chris Angelico via Python-list > wrote: > > On Tue, 14 Nov 2023 at 10:00, Dom Grigonis via

Re: xor operator

2023-11-13 Thread Dom Grigonis via Python-list
applied to many bits. This is more in line with cases that `any` and `all` builtins are used. > On 14 Nov 2023, at 00:51, Grant Edwards via Python-list > wrote: > > On 2023-11-13, Dom Grigonis via Python-list wrote: >> Hi All, >> >> I think it could be useful to

Re: xor operator

2023-11-13 Thread Dom Grigonis via Python-list
urn intermediate == n > > > > On Mon, Nov 13, 2023 at 4:05 PM Barry via Python-list <mailto:python-list@python.org>> wrote: > > > > On 13 Nov 2023, at 17:48, Dom Grigonis > <mailto:dom.grigo...@gmail.com>> wrote: > > > > Short circuit

Re: xor operator

2023-11-13 Thread Dom Grigonis via Python-list
y wrote: > > > >> On 13 Nov 2023, at 17:48, Dom Grigonis wrote: >> >> Short circuiting happens, when: >> xor([True, True, False, False], n=1) >> At index 1 it is clear that the answer is false. > > Can you share an example with 4 values that is true?

Re: xor operator

2023-11-13 Thread Dom Grigonis via Python-list
. Regards, DG > On 13 Nov 2023, at 19:42, Barry wrote: > > > >> On 13 Nov 2023, at 15:16, Dom Grigonis via Python-list >> wrote: >> >> I think it could be useful to have `xor` builtin, which has API similar to >> the one of `any` and `all`. >

xor operator

2023-11-13 Thread Dom Grigonis via Python-list
Hi All, I think it could be useful to have `xor` builtin, which has API similar to the one of `any` and `all`. * Also, it could have optional second argument `n=1`, which indicates how many positives indicates `True` return. * For complete flexibility 3rd argument could indicate if `the number`

Re: Question(s)

2023-10-24 Thread Dom Grigonis via Python-list
I don’t think there i a simple answer to this, although if you find something interesting, please share. From my experience, industry is applying variety of testing methods. Starting from lowest level components and implementing unit tests, finishing with end-to-end testing platforms. https://

Re: Using generator expressions

2023-09-25 Thread Dom Grigonis via Python-list
y = test1(*[a for a in st]) y = test1(*st) Maybe any of these would be ok for you? Regards, DG > On 25 Sep 2023, at 17:15, Jonathan Gossage via Python-list > wrote: > > I am having a problem using generator expressions to supply the arguments > for a class instance initialization. The followi

Re: iterations destroy reversed() results

2023-09-03 Thread Dom Grigonis via Python-list
It is by design. `sorted` returns a list, while `reversed` returns an iterator. Iterators are exhaust-able, and not reusable. So be mindful of this and if you are going to "re-use” the sequence returned by iterator, convert it to list first. Have a look at `itertools` library, which contains a

Re: Fallback for operator and other dunder methods

2023-08-04 Thread Dom Grigonis via Python-list
cases. Well, at least it’s what I got to. __getattr__ feels very hacky for such case, so maybe it’s for the best. > On 2 Aug 2023, at 19:54, Edmondo Giovannozzi via Python-list > wrote: > > Il giorno mercoledì 26 luglio 2023 alle 20:35:53 UTC+2 Dom Grigonis ha > scritto: &

Re: Fallback for operator and other dunder methods

2023-07-26 Thread Dom Grigonis via Python-list
Tried exactly that and didn’t work. Neither __getattr__, nor __getattribute__ of meta is being invoked. > On 26 Jul 2023, at 10:01, Chris Angelico via Python-list > wrote: > > On Wed, 26 Jul 2023 at 16:52, Dom Grigonis wrote: >> >> Could you give an example? Someth

Re: Fallback for operator and other dunder methods

2023-07-25 Thread Dom Grigonis via Python-list
Could you give an example? Something isn’t working for me. > On 26 Jul 2023, at 09:40, Chris Angelico via Python-list > wrote: > > On Wed, 26 Jul 2023 at 12:23, Dom Grigonis via Python-list > wrote: >> print(a + 1)# TypeError: unsupported operand type(s) fo

Fallback for operator and other dunder methods

2023-07-25 Thread Dom Grigonis via Python-list
To illustrate what I was trying to achieve: class A: def __init__(self, arr): self.arr = arr def __getattr__(self, name): arr_method = getattr(self.arr, name) def wrapper(*args, **kwargs): new_arr = arr_method(*args, **kwargs) return type(se

Re: Meta Class Maybe?

2023-07-24 Thread Dom Grigonis via Python-list
> On 23 Jul 2023, at 02:12, Chris Nyland via Python-list > wrote: > > So I am stuck on a problem. I have a class which I want to use to create > another class without having to go through the boiler plate of subclassing. > Specifically because the subclass needs to have certain class attribute

cx_Oracle, callfunc and varray

2015-01-09 Thread Dom
expression is of wrong type ORA-06550: line 1, column 7: PL/SQL: Statement ignored Any ideas what I'm doing wrong? Dom -- https://mail.python.org/mailman/listinfo/python-list

Peer To Peer File Sharing...

2008-01-08 Thread Dom Rout
Hello. Well, this is my first post on any USENET group anywhere, so I hope I get it right. Basically, I just want to get some opinions on a plan of mine for a new project. I want to produce a small, peer to peer, file sharing network for the use of myself and some of my friends. The purpose of thi

Re: SEO - Search Engine Optimization - Seo Consulting

2007-05-01 Thread Dom Robinson
hoose rudeness over courtesy can expect to be called down > > for it - which is arguably rude in itself, but on usenet one reaps what > > one sows. Someone who can't deal with that, shouldn't be on usenet. > > > > sherm-- > > > > -- > > Web Ho

Re: SEO - Search Engine Optimization - Seo Consulting

2007-04-29 Thread Dom Robinson
In article <[EMAIL PROTECTED]>, "Alvin Bruney [MVP]" says... > Please don't spam this group > A top-poster replies to a spammer. Now that world has truly gone mad(!) -- Dom Robinson Gamertag: DVDfever email: dom at dvdfever dot co dot uk /* http://DVDfever.