On 22 Dec. 2017 12:32 pm, "Chris Angelico" wrote:
On Fri, Dec 22, 2017 at 9:43 AM, Chris Barker wrote:
> Every python object has an object identity, and the way to get it is with
> the id() function. The id is also part of the default object repr, but
On Fri, Dec 22, 2017 at 9:43 AM, Chris Barker wrote:
> Every python object has an object identity, and the way to get it is with
> the id() function. The id is also part of the default object repr, but given
> that some, but only some objects have the id in their repr, it's
On Thu, Dec 21, 2017 at 12:34 PM, Barry wrote:
> > On 21 Dec 2017, at 06:57, Chris Barker wrote:
> >
> > in theory, the "goal" is for eval(repr(obj)) to return an equivalent
> object
>
> Is that really was the goal of repr?
I think so -- see the
Could we call it "help"? Maybe add some beef to what's already there...
>>> help(lambda x,y,*args: x)
Help on function in module __main__:
lambda x, y, *args
On Thu, Dec 21, 2017 at 12:34 PM, Barry wrote:
>
>
> > On 21 Dec 2017, at 06:57, Chris Barker
> On 21 Dec 2017, at 06:57, Chris Barker wrote:
>
> in theory, the "goal" is for eval(repr(obj)) to return an equivelent object
Is that really was the goal of repr? If true then we would not need pickle.
I have always assumed that repr of simple things aims to
On Mon, Dec 18, 2017 at 5:31 AM, Steve Barnes
wrote:
> I see it as showing that the information is already available to anybody
> who needs it so I question the usefulness of changing repr (for
> everybody)
> @dataclass
> class C:
> a: "the a parameter" # field with
I'm in the middle of moving, so I'm not planning to take this any farther
than this email unless someone explicitly brings up an issue by emailing
Python-ideas-owner where Titus can help anyone out.
On Wed, Dec 20, 2017, 16:11 Steven D'Aprano, wrote:
> On Wed, Dec 20, 2017
On Wed, Dec 20, 2017 at 03:55:01PM -0500, Franklin? Lee wrote:
> Wow, that's way too aggressive for this list.
Hair-trigger sensitivity to "aggressiveness" is itself a form of
aggression, because it leads to unfair accusations of aggressiveness
and other over-reactions, and forces people to
On Mon, Dec 18, 2017 at 8:31 AM, Steve Barnes wrote:
>
> On 18/12/2017 11:43, Steven D'Aprano wrote:
>> On Mon, Dec 18, 2017 at 07:54:17AM +, Steve Barnes wrote:
>>
>>> Isn't this exactly the sort of information already available via
>>> inspect.getardspec,
On 18/12/2017 11:43, Steven D'Aprano wrote:
> On Mon, Dec 18, 2017 at 07:54:17AM +, Steve Barnes wrote:
>
>> Isn't this exactly the sort of information already available via
>> inspect.getardspec, inspect.getsourcelines & inspect.getsource?
>
> [snip ipython interactive session showing
Serhiy,
I like the idea, but in typeshed we have an agreement to always show a
default value by an ellipsis.
For example, definition like this:
def fun(x, y, z=0):
return x + y + z
can be represented like this
fun(x, y, z=...)
or if one has annotations in the definition, then
fun(x: int,
On Mon, Dec 18, 2017 at 07:54:17AM +, Steve Barnes wrote:
> Isn't this exactly the sort of information already available via
> inspect.getardspec, inspect.getsourcelines & inspect.getsource?
[snip ipython interactive session showing that the answer is "Yes"]
You answered your own question:
On 18/12/2017 06:11, Ivan Pozdeev via Python-ideas wrote:
> On 17.12.2017 22:20, Serhiy Storchaka wrote:
>> Currently repr of doesn't contain much of information besides that it
>> is a lambda.
>>
>> >>> lambda x: x**2
>> at 0x7f3479b74488>
>>
>> All lambdas have the same repr, different only
17.12.17 22:55, Terry Reedy пише:
What if include the signature and the expression of the lambda in its
repr?
>>> lambda x: x**2
Printing the return value requires adding a code or function attribute.
Yes, this requires adding an optional constant code attribute.
The return
On 17.12.2017 22:20, Serhiy Storchaka wrote:
Currently repr of doesn't contain much of information besides that it
is a lambda.
>>> lambda x: x**2
at 0x7f3479b74488>
All lambdas have the same repr, different only by unreadable
hexadecimal address.
What if include the signature and the
On 12/17/2017 2:20 PM, Serhiy Storchaka wrote:
Currently repr of doesn't contain much of information besides that it is
a lambda.
>>> lambda x: x**2
at 0x7f3479b74488>
All lambdas have the same repr, different only by unreadable hexadecimal
address.
Having the same pseudo-name is what
Currently repr of doesn't contain much of information besides that it is
a lambda.
>>> lambda x: x**2
at 0x7f3479b74488>
All lambdas have the same repr, different only by unreadable hexadecimal
address.
What if include the signature and the expression of the lambda in its repr?
>>> lambda
17 matches
Mail list logo