Differences between revisions 6 and 7
Revision 6 as of 2014-04-20 11:42:54
Size: 986
Editor: techtonik
Comment: reference to discussion
Revision 7 as of 2014-04-20 11:49:08
Size: 1102
Editor: techtonik
Comment: update status
Deletions are marked like this. Additions are marked like this.
Line 6: Line 6:
  discussion: [3], status: Sep 29 02:21:43 CEST 2013   discussion: [3], status: Sep 29 21:13:59 CEST 2013
Line 31: Line 31:
 - retrieving abs dir is trivial code (Cameron Simpson. Nick Coghlan)  - retrieving abs dir is trivial code (Cameron Simpson)
Line 34: Line 34:
 - everybody should use 35 for new ideas (Nick Coghlan, Terry Reedy)
 - retrieving abs dir is trivial code in 35 (Nick Coghlan)

FILE, DIR

inspired by: PHP __DIR__, __FILE__ [1]
status:
  python34: __file__ is absolute [2]
  discussion: [3], status: Sep 29 21:13:59 CEST 2013

variants:
 - name: with import (27,33 compatible)
   set:
    - from os.path import FILE, DIR
    - from hacks import FILE, DIR
    - from future import FILE, DIR

 - name: auto global (28,35)
   set:
    - FILE, DIR
    - __file__, __dir__
    - __abs_file__, __abs_dir__ (MRAB, Philipp A.)
  1. http://www.php.net/manual/en/language.constants.predefined.php

  2. https://docs.python.org/3.5/whatsnew/3.4.html

  3. https://mail.python.org/pipermail/python-ideas/2013-September/023469.html

objections:
 - new globals are bad (Cameron Simpson)
 - names starting with __ are bad (Cameron Simpson)
 - retrieving abs dir is trivial code (Cameron Simpson)
 - abspath is not always possible (Cameron Simpson)
 - there should not be convenience functions (Cameron Simpson)
 - everybody should use 35 for new ideas (Nick Coghlan, Terry Reedy)
 - retrieving abs dir is trivial code in 35 (Nick Coghlan)

techtonik/ideas (last edited 2025-03-16 15:48:39 by elena)

Unable to edit the page? See the FrontPage for instructions.