On 2023-08-04, Chris Angelico via Python-list wrote:
> On Sat, 5 Aug 2023 at 09:36, dn via Python-list
> wrote:
>
>> Faced with a situation where an argument may be a scalar-value or an
>> iterable, I'll presume the latter, eg throw it straight into a for-loop.
>> If that fails (because the
On Sat, 5 Aug 2023 at 09:36, dn via Python-list wrote:
> Faced with a situation where an argument may be a scalar-value or an
> iterable, I'll presume the latter, eg throw it straight into a for-loop.
> If that fails (because the argument is a scalar), use try-except to
> re-route the logic.
On 05/08/2023 11.18, Chris Angelico via Python-list wrote:
On Sat, 5 Aug 2023 at 09:08, dn via Python-list wrote:
On 03/08/2023 11.38, Jon Ribbens via Python-list wrote:
On 2023-08-02, dn wrote:
Can you please explain why a multi-part second-argument must be a tuple
and not any other form
On Sat, 5 Aug 2023 at 09:08, dn via Python-list wrote:
>
> On 03/08/2023 11.38, Jon Ribbens via Python-list wrote:
> > On 2023-08-02, dn wrote:
> >> Can you please explain why a multi-part second-argument must be a tuple
> >> and not any other form of collection-type?
> >
> > The following
On 03/08/2023 11.38, Jon Ribbens via Python-list wrote:
On 2023-08-02, dn wrote:
Can you please explain why a multi-part second-argument must be a tuple
and not any other form of collection-type?
The following comment may hold a clue:
if (PyTuple_Check(cls)) {
/* Not a general
>
> Jason Friedman wrote at 2023-8-3 21:34 -0600:
> > ...
> >my_frame = inspect.currentframe()
> > ...
> >My question is: let's say I wanted to add a type hint for my_frame.
>
> `my_frame` will be an instance of `Types.FrameType`.
>
Confirmed. Thank you!
--
Jason Friedman wrote at 2023-8-3 21:34 -0600:
> ...
>my_frame = inspect.currentframe()
> ...
>My question is: let's say I wanted to add a type hint for my_frame.
`my_frame` will be an instance of `Types.FrameType`.
--
https://mail.python.org/mailman/listinfo/python-list
The issue was more of a wrapping around numpy array. Found the solution
already. Unfortunately, there is no equivalent to __getattr__, the only way is
to dynamically define them from meta. It seems it’s pretty standard to just
have a collection of special method names and using them for similar
Il giorno mercoledì 26 luglio 2023 alle 20:35:53 UTC+2 Dom Grigonis ha scritto:
> 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
On 2023-08-02, dn wrote:
> Can you please explain why a multi-part second-argument must be a tuple
> and not any other form of collection-type?
The following comment may hold a clue:
if (PyTuple_Check(cls)) {
/* Not a general sequence -- that opens up the road to
> My question is: let's say I wanted to add a type hint for my_frame.
> >
> > my_frame: some_class_name = inspect.currentframe()
> >
> > What would I put for some_class_name?
> > "frame" (without quotations) is not recognized,
> > Nor is inspect.frame.
>
> We know Python code is executed in an
11 matches
Mail list logo