From 10dcabd7a8f5d1295ec462bc39fe1a2bd23a75d8 Mon Sep 17 00:00:00 2001 From: Andrey Vlasovskikh Date: Tue, 16 Dec 2014 18:51:21 +0300 Subject: [PATCH] Snapshot of python-skeletons @ 983e594 --- python/helpers/python-skeletons/README.md | 5 +++++ python/helpers/python-skeletons/__builtin__.py | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/python/helpers/python-skeletons/README.md b/python/helpers/python-skeletons/README.md index 446ad39a7a73..f6f4ebfe221d 100644 --- a/python/helpers/python-skeletons/README.md +++ b/python/helpers/python-skeletons/README.md @@ -67,6 +67,7 @@ should import it explicitly. For example, in a skeleton for the `foo` module: ```python import foo + class C(foo.B): def bar(): """Do bar and return Bar. @@ -144,6 +145,7 @@ class C(object): pass ``` + ### Versioning The recommended way of checking the version of Python is: @@ -151,10 +153,12 @@ The recommended way of checking the version of Python is: ```python import sys + if sys.version_info >= (2, 7) and sys.version_info < (3,): def from_27_until_30(): pass ``` + A skeleton should document the most recently released version of a library. Use deprecation warnings for functions that have been removed from the API. @@ -214,6 +218,7 @@ the skeletons GitHub repository into your PyCharm/IntelliJ config directory: cd git clone https://github.com/JetBrains/python-skeletons.git ``` + where `` is: * PyCharm diff --git a/python/helpers/python-skeletons/__builtin__.py b/python/helpers/python-skeletons/__builtin__.py index afa270ba02b3..478e6c3f61c5 100644 --- a/python/helpers/python-skeletons/__builtin__.py +++ b/python/helpers/python-skeletons/__builtin__.py @@ -427,6 +427,24 @@ class int(object): """ pass + def __eq__(self, y): + return False + + def __ne__(self, y): + return False + + def __lt__(self, y): + return False + + def __gt__(self, y): + return False + + def __le__(self, y): + return False + + def __ge__(self, y): + return False + def __add__(self, y): """Sum of x and y.