Re: [Python-ideas] String and bytes bitwise operations

2018-05-18 Thread Facundo Batista
2018-05-18 13:32 GMT-03:00 Chris Barker via Python-ideas : > or would it operate on the whole sequence as a single collection of bits? Once you think as the whole sequence of bytes as a sequence of bits (eight times longer, of course), all questions are easly answered,

Re: [Python-ideas] Have a "j" format option for lists

2018-05-10 Thread Facundo Batista
2018-05-10 10:34 GMT-03:00 Chris Angelico : >> >> Ideally, it will handle *any* iterable. > > If it's to handle arbitrary iterables, it can't be the normal style of > "take this string, pass it to the object's __format__ method, and let > it interpret it". That's why I suggested

Re: [Python-ideas] Have a "j" format option for lists

2018-05-10 Thread Facundo Batista
2018-05-10 8:02 GMT-03:00 Rhodri James <rho...@kynesim.co.uk>: > On 09/05/18 20:56, Facundo Batista wrote: >> >> 2018-05-09 13:48 GMT-03:00 Rhodri James <rho...@kynesim.co.uk>: >> >>> -1 until you give me an actual spec rather than a curious example. >

Re: [Python-ideas] Have a "j" format option for lists

2018-05-10 Thread Facundo Batista
> I would like to see you flesh out the idea. In particular, I'd like to see you > address cases where: > 1. The underlying members in the collection are not strings. Besides the basic >types such as numbers, it would also be nice to be able to apply formats >recursively so that one can

Re: [Python-ideas] Have a "j" format option for lists

2018-05-10 Thread Facundo Batista
2018-05-09 21:45 GMT-03:00 Steven D'Aprano <st...@pearwood.info>: > On Wed, May 09, 2018 at 04:56:38PM -0300, Facundo Batista wrote: >> 2018-05-09 13:48 GMT-03:00 Rhodri James <rho...@kynesim.co.uk>: >> >> > -1 until you give me an actual spec rather tha

Re: [Python-ideas] Have a "j" format option for lists

2018-05-09 Thread Facundo Batista
2018-05-09 13:48 GMT-03:00 Rhodri James : > -1 until you give me an actual spec rather than a curious example. > > Sorry if that sounds a bit rude, but I spend most of my time trying to find Be sorry, it was rude. This list is for throwing ideas and see if they gain

[Python-ideas] Have a "j" format option for lists

2018-05-09 Thread Facundo Batista
This way, I could do: >>> authors = ["John", "Mary", "Estela"] >>> "Authors: {:, j}".format(authors) 'Authors: John, Mary, Estela' In this case the join can be made in the format yes, but this proposal would be very useful when the info to format comes inside a structure together with other

Re: [Python-ideas] Descouraging the implicit string concatenation

2018-03-14 Thread Facundo Batista
2018-03-14 11:09 GMT-03:00 Stephan Houben : > Note that this has already been proposed and rejected before: > > https://www.python.org/dev/peps/pep-3126/ What was proposed and reject was the *removal* of the feature/syntax. I propose the discouragement of the idiom.

Re: [Python-ideas] Descouraging the implicit string concatenation

2018-03-14 Thread Facundo Batista
2018-03-14 10:54 GMT-03:00 Paul Moore : > Also, we need to consider the significant body of code that would > break if this construct were prohibited. Even if we were to agree that > the harm caused by implicit concatenation outweighed the benefits, > that would *still* not

[Python-ideas] Descouraging the implicit string concatenation

2018-03-14 Thread Facundo Batista
Hello! What would you think about formally descouraging the following idiom? long_string = ( "some part of the string " "with more words, actually is the same " "string that the compiler puts together") We should write the following, instead: long_string = (