IMO, there're lots of use cases in parsing related stuffs, which requires
rindex a lot, say, when you have generated a tokenizer which might across
multiple lines:
line 8: X """
line 9:
line 10: """
In this case, we need to extract 2 tokens X and , a multiline whitespace
string. After
>
>
> -- Forwarded message --
> From: Martin Bammer
> To: python-ideas@python.org
> Cc:
> Bcc:
> Date: Sat, 1 Sep 2018 09:47:04 +0200
> Subject: [Python-ideas] Add recordlcass to collections module
> Hi,
>
> what about adding recordclass
>
.
Back to the topic, this thread seems to be closed now, and in my opinion
`:=` could be synthetically the best.
2018-04-17 15:11 GMT+08:00 Mikhail V <mikhail...@gmail.com>:
> On Tue, Apr 17, 2018 at 6:09 AM, Thautwarm Zhao <yaoxiansa...@gmail.com>
> wrote:
>
> >
> &g
> We have ways of cheating a bit if we want to reinterpret the semantics
> of something that nevertheless parses cleanly - while the parser is
> limited to single token lookahead, it's straightforward for the
> subsequent code generation stage to look a single level down in the
> parse tree and
>
>
> 0.
>
> while (items[i := i+1] := read_next_item()) is not None:
> print(r'%d/%d' % (i, len(items)), end='\r')
>
> 1.
>
> while (read_next_item() -> items[(i+1) -> i]) is not None:
> print(r'%d/%d' % (i, len(items)), end='\r')
>
> 2.
>
> while (item := read_next_item()) is not None:
>
> To me, "from" strongly suggests that an element is being obtained from a
container/collection of
> elements. This is how I conceptualize "from module import name": "name"
refers to an object
> INSIDE the module, not the module itself. If I saw
>
> if (match from pattern.search(data)) is not
ne if var:= function() is None else var.method()
>
> Still not bad looking.
>
> On Thu, Apr 12, 2018, 11:01 PM Thautwarm Zhao <yaoxiansa...@gmail.com>
> wrote:
>
>>
>> > You're looking at a very early commit there. I suggest looking at the
>> > most
d in a general expression, just as
`test` is the top of expression, an expression using `as` binding must be
in the structure `test`.
In other words, if you write
with expr as name:
# do stuff
Without doubt it's equivalent to `with (expr as name)`.
Or you want to completely change the grammar
ted dicts.
> And if you dont actually want to destruct (tuples and lists aren't
> destroyed either), just use __getitem__ access instead of pop.
But pop cannot work for a nested case.
Feel free to end this topic.
thautwarm
2018-04-10 23:20 GMT+08:00 <python-ideas-requ...@python.org>
Your library seems difficult to extract values from nested dictionary, and
when the key is not an identifier it's also embarrassed.
For sure we can have a library using graphql syntax to extract data from
the dict of any schema, but that's not my point.
I'm focused on the consistency of the
I'm sorry that I didn't send a copy of the discussions here.
-- Forwarded message --
From: Thautwarm Zhao <yaoxiansa...@gmail.com>
Date: 2018-04-09 1:24 GMT+08:00
Subject: Re: [Python-ideas] Is there any idea about dictionary destructing?
To: "Eric V. Smith" <
= name -> true | _ -> false let recordX = { Name = "Parker"; ID
= 10 } let isMatched1 = IsMatchByName recordX "Parker" let isMatched2 =
IsMatchByName recordX "Hartono"
All of them partially destructs(or matches) a dictionary.
thautwarm
12 matches
Mail list logo