File: //opt/alt/python27/lib/python2.7/site-packages/future/types/newstr.pyc
�
�A�[c @ s� d Z d d l m Z d d l m Z d d l m Z m Z m Z m Z d d l
m Z m Z d d l
m Z e r} e Z n d e f d � � YZ d e e e � f d
� � YZ d g Z d S( s
This module redefines ``str`` on Python 2.x to be a subclass of the Py2
``unicode`` type that behaves like the Python 3.x ``str``.
The main differences between ``newstr`` and Python 2.x's ``unicode`` type are
the stricter type-checking and absence of a `u''` prefix in the representation.
It is designed to be used together with the ``unicode_literals`` import
as follows:
>>> from __future__ import unicode_literals
>>> from builtins import str, isinstance
On Python 3.x and normally on Python 2.x, these expressions hold
>>> str('blah') is 'blah'
True
>>> isinstance('blah', str)
True
However, on Python 2.x, with this import:
>>> from __future__ import unicode_literals
the same expressions are False:
>>> str('blah') is 'blah'
False
>>> isinstance('blah', str)
False
This module is designed to be imported together with ``unicode_literals`` on
Python 2 to bring the meaning of ``str`` back into alignment with unprefixed
string literals (i.e. ``unicode`` subclasses).
Note that ``str()`` (and ``print()``) would then normally call the
``__unicode__`` method on objects in Python 2. To define string
representations of your objects portably across Py3 and Py2, use the
:func:`python_2_unicode_compatible` decorator in :mod:`future.utils`.
i����( t Iterable( t Number( t PY3t istextt with_metaclasst
isnewbytes( t not issubset( t newobjectt
BaseNewStrc B s e Z d � Z RS( c C s- | t k r t | t � St | j | � Sd S( N( t newstrt
isinstancet unicodet
issubclasst __class__( t clst instance( ( sD /opt/alt/python27/lib/python2.7/site-packages/future/types/newstr.pyt __instancecheck__9 s
( t __name__t
__module__R ( ( ( sD /opt/alt/python27/lib/python2.7/site-packages/future/types/newstr.pyR 8 s R
c B s e Z d Z d Z d � Z d � Z d � Z d � Z e d � d � � Z e d � d � � Z
d � Z d
� Z d � Z
e d � d � � Z e d � d
� � Z e d d, � d � � Z d � Z d d d � Z e d d � d � � Z e d d � d � � Z e d d � d- d d � � Z e d d � d- d d � � Z e d d � d � � Z e d d � d � � Z e d d � d � � Z e d � Z d � Z d � Z d Z d! � Z d"