Notice: While JavaScript is not essential for this website, your interaction with the content will be limited. Please turn JavaScript on for the full experience.
...direct language comparisons without a lot more documentation.) I've also removed some administrative details from the text and made some minor changes to accommodate HTML. I apologize for the writing style, which is at times more representative of funding proposals than most of the prose I write. I would like to thank Jeremy Hylton, Barry Warsaw, Al Vezza, Bob Kahn, Randy Pausch and David Beazley for contributions and suggestions that made this a successful proposal. --Guido van ...
...dir() function behaves differently than in Python 2.1 and before. Generally, dir() returns more information than it used to do in 2.1. For example, dir([]) also reports the special methods that overload various operators ('__add__', '__getitem__', '__len__', etc.) as well as '__class__'. For classes (classic as well as new-style), it returns the attributes of the class as well as of the base classes. <p><li>The special attributes __members__ and __methods__ are no longer supported...
...dir() call on a module to show deprecated and other dynamically generated attributes, it is proposed to support module level __dir__ function. For example: # lib.py deprecated_names = ["old_function", ...] __all__ = ["new_function_one", "new_function_two", ...] def new_function_one(arg, other): ... def new_function_two(arg, other): ... def __dir__(): return sorted(__all__ + deprecated_names) # main.py import lib dir(lib) # prints ["new_function_one", "new_function_two", "old_f...
...directory, config_settings=None): ... Must create a .dist-info directory containing wheel metadata inside the specified metadata_directory (i.e., creates a directory like {metadata_directory}/{package}-{version}.dist-info/). This directory MUST be a valid .dist-info directory as defined in the wheel specification, except that it need not contain RECORD or signatures. The hook MAY also create other files inside this directory, and a build frontend MUST preserve, but otherwise ignore, such fi...
...dir() function: dir() on an instance (classic or new-style) shows the instance variables as well as the methods and class attributes defined by the instance's class and all its base classes. dir() on a class (classic or new-style) shows the contents of the __dict__ of the class and all its base classes. It does not show class attributes that are defined by a metaclass. dir() on a module shows the contents of the module's __dict__. (This is unchanged.) dir() without argument...
...dir might not show all attributes As with a custom __getattribute__ method dir() might not see all (instance) attributes when using the __getdescriptor__() method to dynamically resolve attributes. The solution for that is quite simple: classes using __getdescriptor__ should also implement __dir__() if they want full support for the builtin dir() function. inspect.getattr_static might not show all attributes The function inspect.getattr_static intentionally does not invoke __getattribute__ and ...
...directory The property TARGETDIR determines the root directory of the Python installation. For example, a different installation drive can be specified with TARGETDIR=R:\python24 The default TARGETDIR is [WindowsVolume]Python<version>. Due to a bug in python-2.4.msi, installing into a target dir that has a space in its name causes the IDLE and pydoc shortcuts to fail. Installation for All Users Adding ALLUSERS=1 causes an installation for all users. By default, t...
...dir() os.mkdir() makedirs() os.makedirs() rmdir() os.rmdir() removedirs() os.removedirs() remove() os.remove() unlink() os.unlink() link() os.link() symlink() os.symlink() readlink() os.readlink() chroot() os.chroot() startfile() os.startfile() copyfile() shutil.copyfile() copymode() shutil.copymode() copystat() shutil.copystat() copy() shutil.copy() copy2() shutil.copy2() copytree() shutil.copytree() move() shutil.move() rmtree() shutil.rmtree() The Path class deprecates th...
...dir(C.f) ['__annotations__', '__call__', '__class__', '__closure__', '__code__', '__defaults__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__get__', '__getattribute__', '__globals__', '__gt__', '__hash__', '__init__', '__kwdefaults__', '__le__', '__lt__', '__module__', '__name__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__'] This limits again the introspection capabilities av...
...directly rather than a factory function At one point, this PEP proposed that the class namespace be passed directly as a keyword argument, rather than passing a factory function. However, this encourages an unsupported behaviour (that is, passing the same namespace to multiple classes, or retaining direct write access to a mapping used as a class namespace), so the API was switched to the factory function version. Reference Implementation A reference implementation for __autodecorate__ has be...
...dir python/nondist rm -rf python/orig for a in python/* do b=`basename $a` cvs2svn -q --dump-only --encoding=latin1 --force-branch=cnri-16-start \ --force-branch=descr-branch --force-branch=release152p1-patches \ --force-tag=r16b1 $a svn mkdir -m"Conversion to SVN" file:///`pwd`/py.new/$b svnadmin load -q --parent-dir $b py.new < cvs2svn-dump rm cvs2svn-dump done Sample results of this conversion are available at http://www.dcl.hpi.uni-potsdam.de/pysvn/ Publish the Repositor...
...dir__() special method to control dir() was added [1] AtheOS support stopped. warnings module implemented in C compile() takes an AST and can convert to byte code Possible features for 2.6 New features should be implemented prior to alpha2, particularly any C modifications or behavioral changes. New features must be implemented prior to beta1 or will require Release Manager approval. The following PEPs are being worked on for inclusion in 2.6: None. Each non-trivial feature listed here that ...
...directory in the parent path: If <directory>/foo/__init__.py is found, a regular package is imported and returned. If not, but <directory>/foo.{py,pyc,so,pyd} is found, a module is imported and returned. The exact list of extension varies by platform and whether the -O flag is specified. The list here is representative. If not, but <directory>/foo is found and is a directory, it is recorded and the scan continues with the next directory in the parent path. Otherwise the scan...
...dir(o: object = ...) -> List[str]: ... def add_friends(friends: Set[Friend]) -> None: ... But not this: def dir(o: object = ...) -> list[str]: ... def add_friends(friends: set[Friend]) -> None ... Why this: up_to_ten = list(range(10)) friends = set() But not this: from typing import List, Set up_to_ten = List[int](range(10)) friends = Set[Friend]() While typing usability is an interesting problem, it is out of scope of this PEP. Specifically, any extensions of the typing syn...