Re: [Python-ideas] Making code objects filename an absolute path.

2019-05-24 Thread Rhodri James

On 24/05/2019 17:35, Batuhan Taskaya wrote:

I was working on bpo20443  but then i
realized it changes behavior of the compiler and some functions so i want
to propose this change to here and then write a pep. I have a draft pr, it
introduces a new future flag and as far as i can understand from the future
docs, i need a PEP.


Could you perhaps say what "this change" is, exactly?  And why it matters.

--
Rhodri James *-* Kynesim Ltd
___
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] Making code objects filename an absolute path.

2019-05-24 Thread Batuhan Taskaya
The bpo i referenced can explain it better. An example;

   def foo(): pass
   assert foo.__code__.co_filename = os.path.abspath(foo.__code__.co_filename)
___
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] Making code objects filename an absolute path.

2019-05-24 Thread Brett Cannon
On Fri, May 24, 2019 at 11:52 AM Batuhan Taskaya 
wrote:

> The bpo i referenced can explain it better. An example;
>
>def foo(): pass
>assert foo.__code__.co_filename = os.path.abspath(foo.__code__.co_filename)
>
>
Do realize there's a reason that issue has been open for well over five
years: changing this will probably break code. And so you need to justify
*why* you think that's acceptable since Python has existed with these
semantics on code objects for decades as this point.
___
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] Making code objects filename an absolute path.

2019-05-24 Thread Batuhan Taskaya
> changing this will probably break code
It is why i'm suggesting making the real transition at 4.0 and adding a
future flag for now.
> And so you need to justify *why* you think that's acceptable
I dont know it is acceptable or not, i saw this issue triaged to stage
"patch required". AFAIK it means someone needs to write a patch for this
issue and i wrote. I'm posting it here because i need to know do i have to
write a pep or just give bpo link to __future__ page.

On Fri, May 24, 2019 at 10:34 PM Brett Cannon  wrote:

>
>
> On Fri, May 24, 2019 at 11:52 AM Batuhan Taskaya 
> wrote:
>
>> The bpo i referenced can explain it better. An example;
>>
>>def foo(): pass
>>assert foo.__code__.co_filename = 
>> os.path.abspath(foo.__code__.co_filename)
>>
>>
> Do realize there's a reason that issue has been open for well over five
> years: changing this will probably break code. And so you need to justify
> *why* you think that's acceptable since Python has existed with these
> semantics on code objects for decades as this point.
>
___
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] Making code objects filename an absolute path.

2019-05-24 Thread Joao S. O. Bueno
On Fri, 24 May 2019 at 16:49, Batuhan Taskaya  wrote:

> > changing this will probably break code
> It is why i'm suggesting making the real transition at 4.0 and adding a
> future flag for now.
>


It is also not reasonable to suppose that "since python 4 is looming in the
horizon we can schedule a lot
of breaking changes for that".  The incompatible changes that took place
on 2->3 won't happen again.

If the absolute path for __file__ is needed and you can demonstrate it, it
is safer
to create another  property like __abs_file__
(this has happened with __qualname__ for example)



> > And so you need to justify *why* you think that's acceptable
> I dont know it is acceptable or not, i saw this issue triaged to stage
> "patch required". AFAIK it means someone needs to write a patch for this
> issue and i wrote. I'm posting it here because i need to know do i have to
> write a pep or just give bpo link to __future__ page.
>
> On Fri, May 24, 2019 at 10:34 PM Brett Cannon  wrote:
>
>>
>>
>> On Fri, May 24, 2019 at 11:52 AM Batuhan Taskaya 
>> wrote:
>>
>>> The bpo i referenced can explain it better. An example;
>>>
>>>def foo(): pass
>>>assert foo.__code__.co_filename = 
>>> os.path.abspath(foo.__code__.co_filename)
>>>
>>>
>> Do realize there's a reason that issue has been open for well over five
>> years: changing this will probably break code. And so you need to justify
>> *why* you think that's acceptable since Python has existed with these
>> semantics on code objects for decades as this point.
>>
> ___
> Python-ideas mailing list
> Python-ideas@python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
___
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] Making code objects filename an absolute path.

2019-05-25 Thread Brett Cannon
On Fri., May 24, 2019, 12:48 Batuhan Taskaya,  wrote:

> > changing this will probably break code
> It is why i'm suggesting making the real transition at 4.0 and adding a
> future flag for now.
> > And so you need to justify *why* you think that's acceptable
> I dont know it is acceptable or not, i saw this issue triaged to stage
> "patch required". AFAIK it means someone needs to write a patch for this
> issue and i wrote.
>

It's a bit more subtle because obviously some of us disagree that there's
an issue and there wasn't any discussion to see if there was consensus.
Plus tests are typically requires first regardless.

-Brett

I'm

> posting it here because i need to know do i have to write a pep or just
> give bpo link to __future__ page.
>
> On Fri, May 24, 2019 at 10:34 PM Brett Cannon  wrote:
>
>>
>>
>> On Fri, May 24, 2019 at 11:52 AM Batuhan Taskaya 
>> wrote:
>>
>>> The bpo i referenced can explain it better. An example;
>>>
>>>def foo(): pass
>>>assert foo.__code__.co_filename = 
>>> os.path.abspath(foo.__code__.co_filename)
>>>
>>>
>> Do realize there's a reason that issue has been open for well over five
>> years: changing this will probably break code. And so you need to justify
>> *why* you think that's acceptable since Python has existed with these
>> semantics on code objects for decades as this point.
>>
>
___
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/