PEP Idea: Multi-get for lists/tuples and dictionaries (inspired in NumPy)

2020-03-18 Thread Santiago Basulto
', 'email': 'fal...@ibm.com' } fname, lname = d[['first_name', 'last_name']] I really like the syntax of boolean arrays too, but considering we have list comprehensions, seems a little more difficult to sell. I'd love to see if this is something people would support, and see if there's room to submit a PEP. -- Santiago Basulto.- Up! -- https://mail.python.org/mailman/listinfo/python-list

Google Search results pointing to Python 2 (most of the time)

2019-07-22 Thread Santiago Basulto
ch with someone that knows about SEO. I just want to start the discussion. Thanks! -- Santiago Basulto.- Up! -- https://mail.python.org/mailman/listinfo/python-list

Re: What Python books to you recommend to beginners?

2018-11-28 Thread Santiago Basulto
it well. The Python tutorial should suit for basic > syntax. > > HTH > -- > https://mail.python.org/mailman/listinfo/python-list > -- Santiago Basulto.- Co-founder @ rmotr.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Generators, generator expressions, and loops

2018-11-16 Thread Santiago Basulto
Try itertools.count() <https://docs.python.org/3/library/itertools.html#itertools.count>. On Fri, Nov 16, 2018 at 12:08 PM Steve Keller wrote: > Cancel ill-formated article > -- > https://mail.python.org/mailman/listinfo/python-list > -- Santiago Basulto.- Co-founder @ r

Re: Why do integers compare equal to booleans?

2018-11-16 Thread Santiago Basulto
expect they cannot > > be equal. I know that 0 means false and != 0 means true in C, C++, > > etc. but in Python that surprises me. > > > > Steve > > > > >>> isinstance(False, int) > True > >>> isinstance(True, int) > True > >>> False.real > 0 > >>> True.real > 1 > >>> > > At least in recent Pythons. > > Duncan > -- > https://mail.python.org/mailman/listinfo/python-list > -- Santiago Basulto.- Co-founder @ rmotr.com -- https://mail.python.org/mailman/listinfo/python-list

Re: @staticmethod or def function()?

2018-10-31 Thread Santiago Basulto
he class unless it was ever also used > by another class. What do you think? > > > > -- > https://mail.python.org/mailman/listinfo/python-list > -- Santiago Basulto.- Up! -- https://mail.python.org/mailman/listinfo/python-list

Possible bug in ThreadPoolExecutor, or just misinterpretation

2018-05-27 Thread Santiago Basulto
<https://docs.python.org/3/library/multiprocessing.html#multiprocessing.pool.Pool.imap_unordered>? Another option might be making `as_completed` work with map results too (which was my original intention). Thanks for your answers in advance! -- Santiago Basulto.- Up! -- https://mail.python.org/mailman/listinfo/python-list

Re: Custom format a la datetime

2015-04-18 Thread Santiago Basulto
On Saturday, April 18, 2015 at 5:29:23 PM UTC-3, Peter Otten wrote: > santiago.basu...@gmail.com wrote: > > > Hello everybody. I'm writing a CLI program to do some search. It's an > > internal tool. I'd like to provide the option to my user to format the > > results as he/she'd like. Something sim

Custom format a la datetime

2015-04-18 Thread santiago . basulto
Hello everybody. I'm writing a CLI program to do some search. It's an internal tool. I'd like to provide the option to my user to format the results as he/she'd like. Something similar to strftime on the datetime module. Example: from datetime import datetime d = datetime.utcnow() d