[Python-ideas] Re: Have del return a value

2023-09-12 Thread Daniel Walker
Makes sense. On Tue, Sep 12, 2023 at 2:55 AM Rob Cliffe via Python-ideas < python-ideas@python.org> wrote: > > > On 08/09/2023 22:19, Christopher Barker wrote: > > On Fri, Sep 8, 2023 at 11:00 AM Barry Scott > wrote: > >> I see no need for del to return anything, you already have the reference

[Python-ideas] Re: Have del return a value

2023-09-07 Thread Daniel Walker
Ah! I like that! On Thu, Sep 7, 2023 at 5:24 PM Tiago Illipronti Girardi < tiagoigira...@gmail.com> wrote: > You would be deleting the name, not the value. `unbind` would be a better > keyword. > ___ > Python-ideas mailing list --

[Python-ideas] Re: Have del return a value

2023-09-07 Thread Daniel Walker
Maybe a new keyword like `delvalue`? On Thu, Sep 7, 2023 at 10:02 AM Chris Angelico wrote: > On Thu, 7 Sept 2023 at 23:51, Daniel Walker wrote: > > > > Perhaps this is a solution in search of a problem but I recently > encountered this situation in one of my projects. > &

[Python-ideas] Have del return a value

2023-09-07 Thread Daniel Walker
Perhaps this is a solution in search of a problem but I recently encountered this situation in one of my projects. I have an object, foo, which, due to the references it contains, I'd rather not keep around longer than necessary. I use foo to instantiate another object: bar = Bar(foo) bar

[Python-ideas] else without except

2023-06-30 Thread Daniel Walker
As most of you probably know, you can use else with try blocks: try: do_stuff() except SomeExceptionClass: handle_error() else: no_error_occurred() Here, no_error_occurred will only be called if do_stuff() didn't raise an exception. However, the following is invalid syntax: try:

[Python-ideas] Re: @lazy decorator an alternative to functools.partial ?

2023-05-17 Thread Daniel Guffey
3 at 2:22 PM Daniel Guffey > wrote: > >> I'm a bit dubious about the pypi suggestion as packages are being >> regularly poisoned with malware ( e.g. New KEKW malware infects >> open-source Python Wheel files via a PyPI distribution | SC Media >> (scmagazine.com) >

[Python-ideas] Re: @lazy decorator an alternative to functools.partial ?

2023-05-17 Thread Daniel Guffey
Thanks for the reference, Lucas. I wasn't familiar with toolz and it looks similar to a package I'm contributing to with a similar purpose of filling holes in the standard library, as such shouldn't some of this stuff be targeted for integration? I'm a bit dubious about the pypi suggestion as

[Python-ideas] @lazy decorator an alternative to functools.partial ?

2023-05-12 Thread Daniel Guffey
Hello all! I've been playing with string templating quite a bit lately and wrote some logic to help me with this. I found it a bit more flexible than using partial and wanted to get feedback to see if it would be worth formalizing this code into the functools module. It's pretty short so I

[Python-ideas] Re: Add switch-case statements in Python

2021-05-04 Thread Daniel Moisset
I'm not sure if you're reading the right document, but PEP 634 refers to 636 in its second paragraph On Tue, 4 May 2021, 19:56 Shreyan Avigyan, wrote: > Ok. Now I'm able to understand. PEP 634 should have a reference to PEP 636 > or else it's pretty hard to understand because the syntax

[Python-ideas] Re: SimpleNamespace vs object

2021-02-17 Thread Daniel Moisset
If we're bike shedding, I'd go for "mutableobject". It's not terribly short, but it is built on familiar python terminology and does exactly what it says in the box: like object() but mutable On Wed, 17 Feb 2021, 23:01 Chris Angelico, wrote: > On Thu, Feb 18, 2021 at 8:53 AM Brendan Barnwell >

[Python-ideas] Re: Add the brotli & zstandard compression algorithms as modules

2020-12-14 Thread Daniel Holth
I think packaging ought to be able to use binary dependencies. Some disagree. The binary ZStandard decompressor could be offered in a gzip-compressed wheel. The reason an improved packaging format can only use ZStandard and not LZMA is that we need to improve everyone's experience, not just

[Python-ideas] Re: Make for/while loops nameable.

2020-12-07 Thread Daniel Moisset
For the likely rare situation where I'd want to do this rather than refactoring into a function, I might try with something like this without requiring changes to the language: from contextlib import contextmanager @contextmanager def breakable(): class Break(Exception): pass def

[Python-ideas] Re: Bringing the print statement back

2020-10-27 Thread Daniel.
My little contribution I will always prefer expressions over statements. So, -1 for bringing back a statement for something that we have a function for. Functions are first citizens, statement are not Now if we are talking about parenthesesless expressions, if we're designing a language from

[Python-ideas] Re: Dict unpacking assignment

2020-10-24 Thread Daniel Moisset
If you find PEP-634 a bit dry, you might give a try to PEP-636 (written in an explanatory style rather than a hard-spec style). You can always go back to PEP-634 for the precise details. On Fri, 23 Oct 2020 at 13:48, Ricky Teachey wrote: > Fwiw, although I see how PEP 634 has the potential to

[Python-ideas] Re: What about having a .get(index, default) method for arrays like we have for dicts?

2020-08-28 Thread Daniel.
Em qui, 27 de ago de 2020 10:37, M.-A. Lemburg escreveu: > On 27.08.2020 15:17, Alex Hall wrote: > > On Thu, Aug 27, 2020 at 3:09 PM M.-A. Lemburg wrote: > > > >> I disagree on the above assessment. I have had such a get() builtin > >> in mxTools for more than 20 years now and found that I

[Python-ideas] Re: What about having a .get(index, default) method for arrays like we have for dicts?

2020-08-27 Thread Daniel.
Em qui, 27 de ago de 2020 10:09, M.-A. Lemburg escreveu: > On 27.08.2020 14:40, Daniel. wrote: > > It's simple: > > > > def get(self, i, default=None): > > try: > > return self[i] > > except IndexError: > > return default &

[Python-ideas] Re: What about having a .get(index, default) method for arrays like we have for dicts?

2020-08-27 Thread Daniel.
An .get method wont hurt duck typing, it makes it better. Also most of the time we're working with plain dicts and lists not abtract classes. If you're typechecking for a Sequence you cant treat it as a list, and this is already true because there are methods in list that dont exists Sequence as

[Python-ideas] Re: What about having a .get(index, default) method for arrays like we have for dicts?

2020-08-25 Thread Daniel.
ty of use cases still exist ( > https://mail.python.org/archives/list/python-ideas@python.org/message/7W74OCYU5WTYFNTKW7PHONUCD3U2S3OO/) > and I think we shouldn't need to keep talking about them. > > On Tue, Aug 25, 2020 at 2:54 PM Daniel. wrote: > >> I just came across this again

[Python-ideas] Re: What about having a .get(index, default) method for arrays like we have for dicts?

2020-08-25 Thread Daniel.
deal with parsing problems yielding sequence of tokens are pretty common and knowing how much tokens are there is a matter of input. When you deal with recursives problems using a stack too.. so there are use cases out there and it's a tiny change Em ter, 25 de ago de 2020 09:52, Daniel

[Python-ideas] Re: What about having a .get(index, default) method for arrays like we have for dicts?

2020-08-25 Thread Daniel.
I just came across this again while implementing an parser I would like to compare stack elements as if stack[-3] == x and stack[-2] == y and stack[-1] == z and somewere below elif stack[-1] == t I had to spread `len(stack)` in a lot of places. People said about the length of a list is

[Python-ideas] Re: What about having a .get(index, default) method for arrays like we have for dicts?

2020-07-03 Thread Daniel.
Em sex, 3 de jul de 2020 11:37, Kyle Lahnakoski escreveu: > > On 2020-06-27 09:34, Daniel. wrote: > > When I need to traverse nested dicts, is a common pattern to do > > > > somedict.get('foo', {}).get('bar', {}) > > > > But there is no such equivalent fo

[Python-ideas] Re: What about having a .get(index, default) method for arrays like we have for dicts?

2020-07-02 Thread Daniel.
Em ter., 30 de jun. de 2020 às 15:49, Alex Hall escreveu: > I think I'm missing something. Daniel wants a `list.get` method with > similar semantics to `dict.get`. So instead of writing: > > ``` > try: > x = lst[i] > except IndexError: > x = default > ``` >

[Python-ideas] Re: What about having a .get(index, default) method for arrays like we have for dicts?

2020-07-02 Thread Daniel.
Em qua, 1 de jul de 2020 00:56, David Lowry-Duda escreveu: > Very similar things could be said about dict.get too, no? It's easy to > write your own function that does the same thing or to catch an > exception. > > On the other hand, it seems far more likely to miss keys in a dictionary > than

[Python-ideas] Re: What about having a .get(index, default) method for arrays like we have for dicts?

2020-06-30 Thread Daniel.
be the use cases for this feature? > > I can't think of one. > > I think that "nice to have" leads to the ways of Perl. > > Regards, > > On Sat, Jun 27, 2020 at 9:34 AM Daniel. wrote: > >> When I need to traverse ne

[Python-ideas] Re: What about having a .get(index, default) method for arrays like we have for dicts?

2020-06-27 Thread Daniel.
Oh, sorry, I will take a look. Thanks! Em sáb., 27 de jun. de 2020 às 12:06, Guido van Rossum escreveu: > Please read PEP 505 before rehashing this old idea. > > On Sat, Jun 27, 2020 at 06:35 Daniel. wrote: > >> When I need to traverse nested dicts, is a co

[Python-ideas] What about having a .get(index, default) method for arrays like we have for dicts?

2020-06-27 Thread Daniel.
When I need to traverse nested dicts, is a common pattern to do somedict.get('foo', {}).get('bar', {}) But there is no such equivalent for arrays, wouldn't be nice if we can follow somedict.get('foo', {}).get('bar', []).get(10) ... ? What I do in this case is surround with try/except

[Python-ideas] Re: "return if "

2020-06-18 Thread Daniel.
it is not worth changing Python over. I agreed here, is doesn't make that difference Em qui, 18 de jun de 2020 14:25, Christopher Barker escreveu: > On Thu, Jun 18, 2020 at 10:00 AM Daniel. wrote: > >> def foo(): >> if a: >> return >> if B: >>

[Python-ideas] Re: "return if "

2020-06-18 Thread Daniel.
arry Scott escreveu: > > > On 18 Jun 2020, at 13:30, Daniel. wrote: > > I love the do_stuff if cond syntax in Ruby and in perl. It's very natural > to real, much more to follow than if cond: do_stuff > > > I on the other hand hate that syntax and find it harder to read.

[Python-ideas] Re: "return if "

2020-06-18 Thread Daniel.
To read* Em qui, 18 de jun de 2020 09:30, Daniel. escreveu: > I love the do_stuff if cond syntax in Ruby and in perl. It's very natural > to real, much more to follow than if cond: do_stuff > > But still I don't think that it is enough to demand a language change. > &

[Python-ideas] Re: "return if "

2020-06-18 Thread Daniel.
I love the do_stuff if cond syntax in Ruby and in perl. It's very natural to real, much more to follow than if cond: do_stuff But still I don't think that it is enough to demand a language change. Something near this is to have a default of none for A if B else None So we can ommit the else

[Python-ideas] Re: zip(x, y, z, strict=True)

2020-04-26 Thread Daniel Moisset
This idea is something I could have used many times. I agree with many people here that the strict=True API is at least "unusual" in Python. I was thinking of 2 different API approaches that could be used for this and I think no one has mentioned: - we could add a callable filler_factory

[Python-ideas] A new itertools.product variant that supports kwargs and returns dicts

2020-02-18 Thread Daniel Grießhaber
When doing a grid-search over some hyper-parameters of an algorithm I often need to specify the possible value space for each parameter and then evaluate on every combination of these values. In this case, the product function of the itertools module is handy: from itertools import product

[Python-ideas] a new itertools.product variant that supports kwargs and returns dicts

2020-02-18 Thread Daniel Grießhaber
When doing a grid-search over some hyper-parameters of an algorithm I often need to specify the possible value space for each parameter and then evaluate on every combination of these values. In this case, the product function of the itertools module is handy: from itertools import product def

[Python-ideas] Re: pickle.reduce and deconstruct

2020-02-08 Thread Daniel Spitz
nd perhaps we can find a time to get started. You're also welcome to jump right in without me if you have the time and motivation. Daniel Spitz ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python

[Python-ideas] Re: pickle.reduce and deconstruct

2020-02-07 Thread Daniel Spitz
ng interesting using esoteric, inappropriate corners of python.) If Andrew's proposal happened, pickle would be uncoupled from that core machinery, and my idea, as well as other interesting ideas, could be implemented in a non-silly way. Daniel Spitz On Thu, Jan 23, 2020 at 7:11 PM Andrew Barnert via P

[Python-ideas] Re: Argumenting in favor of first()

2019-12-11 Thread Daniel Moisset
I think a solution nobody has proposed in this thread is relaxing the next builtin, so it calls iter() on the argument when it doesn't implement the iterator protocol. That would make next([1, 2]) == 1, and also make next([], "missing") == "missing". After that all that is needed is educating the

[Python-ideas] Re: Tuple Comprehension

2019-11-18 Thread Daniel Zeng
To me, however, that would look like a one-element genexp tuple, and would be too easily confused with something like ((i for i in range(10),) ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to

[Python-ideas] Re: Tuple Comprehension

2019-11-17 Thread Daniel Zeng
> > Is this meant to produce a tuple that contains inner tuples, or is it > the same as tuple(i for i in range(10)) ? This would be equivalent to tuple(i for i in range(10)) > Is the comma just magic that says "tuple comprehension, not genexp"? I think that my proposal is consistent with Python's

[Python-ideas] Tuple Comprehension

2019-11-17 Thread Daniel Zeng
Syntax for tuple comprehension, something like: (i, for i in range(10)) This shouldn't result in ambiguity, since generators need to be in parentheses anyway: (i, for i in range(10)) vs (1, (i for i in range(10))) ___ Python-ideas mailing list --

[Python-ideas] Add a `get_profile_dict` function to cProfile

2019-08-16 Thread olshansky . daniel
Hey everyone, I've been using cProfile to profile some of my code, but found out that while the tools to print the results are very convenient, it was difficult to extract and send to a logging tool (i.e. fluentd) where it can be further parsed and analyzed. I'm thinking of adding a function

[Python-ideas] Fwd: Re: PEP: add a `no` keyword as an alias for `not`

2019-08-02 Thread Daniel Okey-Okoro
-- Forwarded message - From: Daniel Okey-Okoro Date: Thu, Aug 1, 2019 at 1:37 PM Subject: Re: [Python-ideas] Re: PEP: add a `no` keyword as an alias for `not` To: Chris Angelico > not a strong enough justification for breaking any code that uses "no" in

[Python-ideas] Fwd: PEP: add a `no` keyword as an alias for `not`

2019-08-02 Thread Daniel Okey-Okoro
-- Forwarded message - From: Daniel Okey-Okoro Date: Thu, Aug 1, 2019 at 1:24 PM Subject: Re: PEP: add a `no` keyword as an alias for `not` To: Calvin Spealman Good point Calvin, But in many cases, when people write

Re: [Python-ideas] zipfile refactor and AES

2019-06-03 Thread Daniel Hillier
Robert Collins wrote: > Is it API compatible with the current zipfile module docs? Yes it should be (that was my intention during the refactor and if I accidentally introduced an incompatibility, I'll fix that up before I attempt to integrate the work). I had a look through the docs again and I

[Python-ideas] zipfile refactor and AES

2019-06-03 Thread Daniel Hillier
Hi, I've written a package that can read and write zip files encrypted with Winzip's AES encryption scheme (https://github.com/danifus/pyzipper/). It is based on Python's zipfile module which I refactored to facilitate adding the AES code as subclasses of the classes defined in the zipfile

Re: [Python-ideas] cli tool to print value, similar to pydoc

2019-04-08 Thread Daniel Bradburn
Could it be q that you are thinking about? Op ma 8 apr. 2019 om 09:10 schreef Paul Moore : > On Sun, 7 Apr 2019 at 12:44, Thomas Gläßle wrote: > > There is already a tool like this on PyPI [1] (sadly py2 only atm), but > > if you agree that this is a common

Re: [Python-ideas] Are we supposed to be able to have our own class dictionary in python 3?

2018-11-04 Thread Daniel Moisset
for to end up with a custom attribute dict (so in *your* case, you do not need to do the copying) On Sun, 4 Nov 2018 at 00:03, Amit Green wrote: > Thanks Daniel, > > I found my answer here (using your link): > https://docs.python.org/3/reference/datamodel.html#preparing-the-class-namespace &g

Re: [Python-ideas] Are we supposed to be able to have our own class dictionary in python 3?

2018-11-03 Thread Daniel Moisset
Sorry, should have replied to the list too On Sat, 3 Nov 2018, 23:55 Daniel Moisset If I understood correctly what you want, it's possible with a metaclass. > Check the __prepare__ method at > https://docs.python.org/3/reference/datamodel.html#preparing-the-class-namespace > and

Re: [Python-ideas] Pre-conditions and post-conditions

2018-08-20 Thread Daniel Moisset
viving >> PEP 316 is likely the best approach. >> >> Paul >> ___ >> Python-ideas mailing list >> Python-ideas@python.org >> https://mail.python.org/mailman/listinfo/python-ideas >> Code of Conduct:

Re: [Python-ideas] Syntactic sugar to declare partial functions

2018-08-04 Thread Daniel.
That's an awesome library! Congratulation for doing this and thanks for sharing! Em sáb, 4 de ago de 2018 às 13:42, Robert Vanden Eynde escreveu: > The funcoperators lib on pypi does exactly that: > > from funcoperators import partially > > @partially > def add(x: int, y: int) -> int: >

Re: [Python-ideas] Add the imath module

2018-07-12 Thread Daniel Moisset
> ___ > Python-ideas mailing list > Python-ideas@python.org > https://mail.python.org/mailman/listinfo/python-ideas > Code of Conduct: http://python.org/psf/codeofconduct/ > -- <https://www.machinalis.com/> Daniel Moisset Technical

[Python-ideas] Check type hints in stack trace printing

2018-06-20 Thread Daniel Sánchez Fábregas
El 14/06/18 a las 14:37, Steven D'Aprano escribió: > On Thu, Jun 14, 2018 at 01:03:37PM +0200, Daniel Sánchez Fábregas wrote: >> My idea consist in: >> Adding a method to perform type checking in traceback objects >> When printing stack traces search for mistyped arguments a

[Python-ideas] Check type hints in stack trace printing

2018-06-14 Thread Daniel Sánchez Fábregas
My idea consist in: Adding a method to perform type checking in traceback objects When printing stack traces search for mistyped arguments and warn about them to the user. Don't know if it is in the roadmap, but seems that have a good cost/benefit ratio to me.

Re: [Python-ideas] Modern language design survey for "assign and compare" statements

2018-05-21 Thread Daniel Moisset
"as" syntax won't give me. > > That use case should be covered by for v in iter(get_something, INCOVENIENT_SENTINEL): do_something(v) -- <https://www.machinalis.co.uk> Daniel Moisset UK COUNTRY MANAGER A: 1 Fore Street, EC2Y 9DT London <https://goo.gl/maps

Re: [Python-ideas] Syntax idea: escaping names to avoid keyword ambiguity

2018-05-14 Thread Daniel Moisset
On 14 May 2018 at 15:02, Clint Hepner <clint.hep...@gmail.com> wrote: > > > On 2018 May 14 , at 6:47 a, Daniel Moisset <dmois...@machinalis.com> > wrote: > > > > Following up some of the discussions about the problems of adding > keywords and Guido's

Re: [Python-ideas] Syntax idea: escaping names to avoid keyword ambiguity

2018-05-14 Thread Daniel Moisset
On 14 May 2018 at 15:02, Clint Hepner <clint.hep...@gmail.com> wrote: > > > On 2018 May 14 , at 6:47 a, Daniel Moisset <dmois...@machinalis.com> > wrote: > > > > Following up some of the discussions about the problems of adding > keywords and Guido's

[Python-ideas] Syntax idea: escaping names to avoid keyword ambiguity

2018-05-14 Thread Daniel Moisset
ut over proliferation of "$" in code, I'm quite sure given past experience that just a notice in PEP 8 of "only with $ in names to prevent ambiguity" should be more than enough for the community What are the drawbacks that you find in this? Best, Daniel [The r

Re: [Python-ideas] Pattern Matching Syntax

2018-05-04 Thread Daniel Moisset
raic data types (which are like unions of namedtuples)as your primary data structure, because there are very natural patterns to decompose those. In Python, there's less value to this because well... it already has all these features so adding a unifying concept after the fact doesn'

Re: [Python-ideas] Pattern Matching Syntax

2018-05-04 Thread Daniel Moisset
; > Where: > > (0, 'blorp')would match the first case, yielding None > > (3, 'hello')would match the second case, yielding > > "hello, hello, hello" > > 'frogs' would match the third case, yielding "frogs" >

Re: [Python-ideas] Move optional data out of pyc files

2018-04-12 Thread Daniel Moisset
ot;1", although most duplicates are some small strings, tuples with argument names, or . Something that could be interesting to write is a "pyc optimizer" that removes duplicates, this should be a gain at a minimal preprocessing cost. On 12 April 2018 at 15:16, Daniel Moisset <dmois

Re: [Python-ideas] Move optional data out of pyc files

2018-04-12 Thread Daniel Moisset
quot;b":"int","return":"int"}. > > This change will require new pyc format, and descriptor for > PyFunction.__doc__, PyFunction.__annotation__ > and type.__doc__. > > Regards, > > -- > INADA Naoki <songofaca...@gmail.com> >

Re: [Python-ideas] Move optional data out of pyc files

2018-04-10 Thread Daniel Moisset
or other settings different docstring file can be used. > > For suppressing line numbers and annotations new options can be added. > > ___ > Python-ideas mailing list > Python-ideas@python.org > https://mail.python.org/mailman/listinfo

Re: [Python-ideas] Accepting multiple mappings as positional arguments to create dicts

2018-04-09 Thread Daniel Moisset
wrote: > Sorry, I didn't know that kwargs unpacking in dictionaries displays don't > raise a TypeError exception. > > On Mon, Apr 9, 2018 at 8:23 AM, Daniel Moisset <dmois...@machinalis.com> > wrote: > >> In which way would this be different to {**mapping1, **mapping

Re: [Python-ideas] Accepting multiple mappings as positional arguments to create dicts

2018-04-09 Thread Daniel Moisset
r thoughts? > > ___ > Python-ideas mailing list > Python-ideas@python.org > https://mail.python.org/mailman/listinfo/python-ideas > Code of Conduct: http://python.org/psf/codeofconduct/ > > -- Daniel F. Moisset - UK Country M

Re: [Python-ideas] .then execution of actions following a future's completion

2018-01-26 Thread Daniel Collins
) and it would be confusing if a few lines later, a “but you can use them for this” example was provided. -dancollins34 Sent from my iPhone > On Jan 26, 2018, at 1:05 PM, Guido van Rossum <gu...@python.org> wrote: > >> On Fri, Jan 26, 2018 at 9:20 AM, Daniel Collins <d

Re: [Python-ideas] .then execution of actions following a future's completion

2018-01-26 Thread Daniel Collins
to submit a callback function back to the executor. Sent from my iPhone > On Jan 26, 2018, at 12:10 PM, Daniel Collins <dancollin...@gmail.com> wrote: > > @Guido: I agree, that’s a much cleaner solution to pass the executor. > However, I think the last line should be future

Re: [Python-ideas] .then execution of actions following a future's completion

2018-01-26 Thread Daniel Collins
:59 AM, Guido van Rossum <gu...@python.org> wrote: > > @Bar: I don't know about exposing _chain_future(). Certainly it's overkill > for what the OP wants -- their PR only cares about chaining > concurrent.future.Future. > > @Daniel: I present the following simpler

Re: [Python-ideas] .then execution of actions following a future's completion

2018-01-26 Thread Daniel Collins
t; >> Also to be honest I don't understand the use case *or* the semantics very >> well. You have some explaining to do... >> >> (Also, full links: https://bugs.python.org/issue32672; >> https://github.com/python/cpython/pull/5335) >> >>> On Thu, Jan 25, 2

Re: [Python-ideas] .then execution of actions following a future's completion

2018-01-26 Thread Daniel Collins
*or* the semantics very > well. You have some explaining to do... > > (Also, full links: https://bugs.python.org/issue32672; > https://github.com/python/cpython/pull/5335) > >> On Thu, Jan 25, 2018 at 8:38 PM, Daniel Collins <dancollin...@gmail.com> >> wrote:

[Python-ideas] .then execution of actions following a future's completion

2018-01-25 Thread Daniel Collins
Hello all, So, first time posting here. I’ve been bothered for a while about the lack of the ability to chain futures in python, such that the next future will execute upon the first’s completion. So I submitted a pr to do this. This would add the .then(self, fn) method to

Re: [Python-ideas] Add a dict with the attribute access capability

2017-11-29 Thread Daniel Moisset
a mixin, or a proxy? Or add several > types? > > > [1] https://bugs.python.org/issue29196 > > ___ > Python-ideas mailing list > Python-ideas@python.org > https://mail.python.org/mailman/listinfo/python-ideas > Code of Conduct: http://python.org/psf/codeofconduct/ > -- Da

Re: [Python-ideas] Dollar operator suggestion

2017-10-26 Thread Daniel Moisset
_ > Python-ideas mailing list > Python-ideas@python.org > https://mail.python.org/mailman/listinfo/python-ideas > Code of Conduct: http://python.org/psf/codeofconduct/ > > -- Daniel F. Moisset - UK Country Manager - Machinalis Limited

[Python-ideas] Defer Statement

2017-06-03 Thread Daniel Bershatsky
Dear Python Developers, We have a potential idea for enhancing Python. You will find a kind of draft bellow. Best regards,Daniel Bershatsky  Abstract This PEP proposes the introduction of new syntax to create community standard,readable and clear way to defered function execution in basic

Re: [Python-ideas] Augmented assignment syntax for objects.

2017-04-25 Thread Daniel Moisset
> later. If nothing else, such a decorator would be a good prototype for > the proposed functionality, and may well be sufficient for the likely > use cases without needing a syntax change. > > Paul > _______ > Python-ideas mailing list &

Re: [Python-ideas] Way to repeat other than "for _ in range(x)"

2017-03-30 Thread Daniel Moisset
e used like >> loop_for or repeat_times etc. >> >> Thoughts? >> >> ___ >> Python-ideas mailing list >> Python-ideas@python.org >> https://mail.python.org/mailman/listinfo/python-ideas >> Code of Conduct: http://python.org/psf/codeofconduct/ >> >> > >

Re: [Python-ideas] if in for-loop statement

2017-02-23 Thread Daniel Moisset
on-ideas mailing list > Python-ideas@python.org > https://mail.python.org/mailman/listinfo/python-ideas > Code of Conduct: http://python.org/psf/codeofconduct/ > -- Daniel F. Moisset - UK Country Manager www.machinalis.com Skype: @dmoisset ___

Re: [Python-ideas] New function to add into the "random" module

2017-02-02 Thread Daniel Moisset
function is tested, it’s working  > > ___ > Python-ideas mailing list > Python-ideas@python.org > https://mail.python.org/mailman/listinfo/python-ideas > Code of Conduct: http://python.org/psf/codeofconduct/ > -- Daniel F. Moisset - UK Country Manager www.machinalis.com Skype: @dmoisset ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/

Re: [Python-ideas] Ideas for improving the struct module

2017-01-18 Thread Daniel Spitz
+1 on the idea of supporting variable-length strings with the length encoded in the preceding packed element! Several months ago I was trying to write a parser and writer of PostgreSQL's COPY ... WITH BINARY format. I started out trying to implement it in pure python using the struct module. Due

Re: [Python-ideas] Proposal: Tuple of str with w'list of words'

2016-11-15 Thread Daniel Moisset
e) to: > > mydf = df[ ('field1', 'field2', 'field3') ] > If using a tuple as an index expression, wouldn't it be ok for you to use: mydf = df['field1', 'field2', 'field3'] ? That should be equivalent to the second example, but without the doble bracketing Best, D. -- Daniel F. Moisset

Re: [Python-ideas] Fwd: Null coalescing operator

2016-09-11 Thread Daniel Moisset
# 3 > {}.values # > None.__class__ # > > --- Bruce > Check out my puzzle book and get it free here: > http://J.mp/ingToConclusionsFree (available on iOS) > > > > ___ > Python-ideas mailing list > Python-ideas@p