€•6IŒsphinx.addnodes”Œdocument”“”)�”}”(Œ rawsource”Œ”Œchildren”]”Œdocutils.nodes”Œsection”“”)�”}”(hhh]”(h Œtitle”“”)�”}”(hŒ!The main differences with CPython”h]”h ŒText”“”Œ!The main differences with CPython”…”�”}”(hhŒparent”hhhŒsource”NŒline”NubaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”uŒtagname”hhh hhhŒ\/home/jac/active/geatec/transcrypt/Transcrypt/transcrypt/docs/sphinx/differences_cpython.rst”hKubh )�”}”(hhh]”(h)�”}”(hŒMDifferences due to the compiled, rather than interpreted nature of Transcrypt”h]”hŒMDifferences due to the compiled, rather than interpreted nature of Transcrypt”…”�”}”(hh1hh/hhhNhNubah}”(h ]”h"]”h$]”h&]”h(]”uh*hhh,hhhh+hKubh Œ bullet_list”“”)�”}”(hhh]”(h Œ list_item”“”)�”}”(hŒSince Transcrypt is precompiled on the development machine, Python's exec and eval are not supported, but JavaScript's eval is.”h]”h Œ paragraph”“”)�”}”(hhFh]”hŒƒSince Transcrypt is precompiled on the development machine, Python’s exec and eval are not supported, but JavaScript’s eval is.”…”�”}”(hhFhhJubah}”(h ]”h"]”h$]”h&]”h(]”uh*hHhh+hKhhDubah}”(h ]”h"]”h$]”h&]”h(]”uh*hBhh?hhhh+hNubhC)�”}”(hŒUC++ style conditional compilation is supported through :ref:`pragmas `.”h]”hI)�”}”(hh_h]”(hŒ7C++ style conditional compilation is supported through ”…”�”}”(hŒ7C++ style conditional compilation is supported through ”hhaubhŒ pending_xref”“”)�”}”(hŒ:ref:`pragmas `”h]”h Œinline”“”)�”}”(hhmh]”hŒpragmas”…”�”}”(hhhhqubah}”(h ]”h"]”(Œxref”Œstd”Œstd-ref”eh$]”h&]”h(]”uh*hohhkubah}”(h ]”h"]”h$]”h&]”h(]”Œrefdoc”Œdifferences_cpython”Œ refdomain”h|Œreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆŒ reftarget”Œ pragma_ifdef”uh*hihh+hKhhaubhŒ.”…”�”}”(hŒ.”hhaubeh}”(h ]”h"]”h$]”h&]”h(]”uh*hHhh+hKhh]ubah}”(h ]”h"]”h$]”h&]”h(]”uh*hBhh?hhhh+hNubhC)�”}”(hŒjConditional import of modules is done by using conditional compilation rather than conditional statements.”h]”hI)�”}”(hh£h]”hŒjConditional import of modules is done by using conditional compilation rather than conditional statements.”…”�”}”(hh£hh¥ubah}”(h ]”h"]”h$]”h&]”h(]”uh*hHhh+hK hh¡ubah}”(h ]”h"]”h$]”h&]”h(]”uh*hBhh?hhhh+hNubhC)�”}”(hŒQSource level debugging in the browser is available through the use of sourcemaps.”h]”hI)�”}”(hhºh]”hŒQSource level debugging in the browser is available through the use of sourcemaps.”…”�”}”(hhºhh¼ubah}”(h ]”h"]”h$]”h&]”h(]”uh*hHhh+hK hh¸ubah}”(h ]”h"]”h$]”h&]”h(]”uh*hBhh?hhhh+hNubhC)�”}”(hŒŽRunning a compiled Transcrypt program doesn't require a Python or Transcrypt interpreter. It only requires the runtime, which is about 40 kB. ”h]”hI)�”}”(hŒ�Running a compiled Transcrypt program doesn't require a Python or Transcrypt interpreter. It only requires the runtime, which is about 40 kB.”h]”hŒ�Running a compiled Transcrypt program doesn’t require a Python or Transcrypt interpreter. It only requires the runtime, which is about 40 kB.”…”�”}”(hhÕhhÓubah}”(h ]”h"]”h$]”h&]”h(]”uh*hHhh+hK hhÏubah}”(h ]”h"]”h$]”h&]”h(]”uh*hBhh?hhhh+hNubeh}”(h ]”h"]”h$]”h&]”h(]”Œbullet”Œ-”uh*h=hh+hKhh,hhubeh}”(h ]”ŒLdifferences-due-to-the-compiled-rather-than-interpreted-nature-of-transcrypt”ah"]”h$]”ŒMdifferences due to the compiled, rather than interpreted nature of transcrypt”ah&]”h(]”uh*h hh hhhh+hKubh )�”}”(hhh]”(h)�”}”(hŒ2Differences due to the 'lean and mean' design goal”h]”hŒ6Differences due to the ‘lean and mean’ design goal”…”�”}”(hhühhúhhhNhNubah}”(h ]”h"]”h$]”h&]”h(]”uh*hhh÷hhhh+hKubh>)�”}”(hhh]”(hC)�”}”(hŒ¯Facilities like operator overloading, automatic truth value conversion and named parameters can be switched on and off locally using pragmas, to keep the generated code small.”h]”hI)�”}”(hj h]”hŒ¯Facilities like operator overloading, automatic truth value conversion and named parameters can be switched on and off locally using pragmas, to keep the generated code small.”…”�”}”(hj hjubah}”(h ]”h"]”h$]”h&]”h(]”uh*hHhh+hKhj ubah}”(h ]”h"]”h$]”h&]”h(]”uh*hBhjhhhh+hNubhC)�”}”(hŒzInterpreting negative indices as offsets from the end of a list or string requires operator overloading to be switched on.”h]”hI)�”}”(hj$h]”hŒzInterpreting negative indices as offsets from the end of a list or string requires operator overloading to be switched on.”…”�”}”(hj$hj&ubah}”(h ]”h"]”h$]”h&]”h(]”uh*hHhh+hKhj"ubah}”(h ]”h"]”h$]”h&]”h(]”uh*hBhjhhhh+hNubhC)�”}”(hŒ˜String formatting is done through the *format* method or through f-strings, as this is considered most flexible. Using % for formatting isn't supported.”h]”hI)�”}”(hj;h]”(hŒ&String formatting is done through the ”…”�”}”(hŒ&String formatting is done through the ”hj=ubh Œemphasis”“”)�”}”(hŒ*format*”h]”hŒformat”…”�”}”(hhhjGubah}”(h ]”h"]”h$]”h&]”h(]”uh*jEhj=ubhŒl method or through f-strings, as this is considered most flexible. Using % for formatting isn’t supported.”…”�”}”(hŒj method or through f-strings, as this is considered most flexible. Using % for formatting isn't supported.”hj=ubeh}”(h ]”h"]”h$]”h&]”h(]”uh*hHhh+hKhj9ubah}”(h ]”h"]”h$]”h&]”h(]”uh*hBhjhhhh+hNubhC)�”}”(hŒÇSome methods of container types like list, set and dict, that duplicate functionality of other methods, have been left out of the core libraries. If needed they can be supplied in separate libraries.”h]”hI)�”}”(hjhh]”hŒÇSome methods of container types like list, set and dict, that duplicate functionality of other methods, have been left out of the core libraries. If needed they can be supplied in separate libraries.”…”�”}”(hjhhjjubah}”(h ]”h"]”h$]”h&]”h(]”uh*hHhh+hKhjfubah}”(h ]”h"]”h$]”h&]”h(]”uh*hBhjhhhh+hNubhC)�”}”(hŒWMetaclasses only support overloading the __new__ method, covering 90% of the use cases.”h]”hI)�”}”(hjh]”hŒWMetaclasses only support overloading the __new__ method, covering 90% of the use cases.”…”�”}”(hjhj�ubah}”(h ]”h"]”h$]”h&]”h(]”uh*hHhh+hKhj}ubah}”(h ]”h"]”h$]”h&]”h(]”uh*hBhjhhhh+hNubhC)�”}”(hŒ·Currently the \*, /, //, +, -, @, [], (), ==, !=, <, <=, >, >=, \*\*, << and >> operators can be overloaded, both forward and reverse where appropriate, covering almost all usecases.”h]”hI)�”}”(hj–h]”hŒ·Currently the *, /, //, +, -, @, [], (), ==, !=, <, <=, >, >=, **, << and >> operators can be overloaded, both forward and reverse where appropriate, covering almost all usecases.”…”�”}”(hŒ·Currently the \*, /, //, +, -, @, [], (), ==, !=, <, <=, >, >=, \*\*, << and >> operators can be overloaded, both forward and reverse where appropriate, covering almost all usecases.”hj˜ubah}”(h ]”h"]”h$]”h&]”h(]”uh*hHhh+hKhj”ubah}”(h ]”h"]”h$]”h&]”h(]”uh*hBhjhhhh+hNubhC)�”}”(hŒGThe 'with' statement can currently only be used for file-like objects. ”h]”hI)�”}”(hŒFThe 'with' statement can currently only be used for file-like objects.”h]”hŒJThe ‘with’ statement can currently only be used for file-like objects.”…”�”}”(hj²hj°ubah}”(h ]”h"]”h$]”h&]”h(]”uh*hHhh+hKhj¬ubah}”(h ]”h"]”h$]”h&]”h(]”uh*hBhjhhhh+hNubeh}”(h ]”h"]”h$]”h&]”h(]”híhîuh*h=hh+hKhh÷hhubeh}”(h ]”Œ0differences-due-to-the-lean-and-mean-design-goal”ah"]”h$]”Œ2differences due to the 'lean and mean' design goal”ah&]”h(]”uh*h hh hhhh+hKubh )�”}”(hhh]”(h)�”}”(hŒLDifferences due to interoperability with JavaScript and JavaScript libraries”h]”hŒLDifferences due to interoperability with JavaScript and JavaScript libraries”…”�”}”(hj×hjÕhhhNhNubah}”(h ]”h"]”h$]”h&]”h(]”uh*hhjÒhhhh+hKubh>)�”}”(hhh]”(hC)�”}”(hŒ~Python objects, functions and methods and their JavaScript counterparts can in general be mixed freely without special syntax.”h]”hI)�”}”(hjèh]”hŒ~Python objects, functions and methods and their JavaScript counterparts can in general be mixed freely without special syntax.”…”�”}”(hjèhjêubah}”(h ]”h"]”h$]”h&]”h(]”uh*hHhh+hKhjæubah}”(h ]”h"]”h$]”h&]”h(]”uh*hBhjãhhhh+hNubhC)�”}”(hŒàTo be able to use JSON-like syntax in configuring JavaScript libraries, Transcrypt dicts are in fact JavaScript objects. Attribute keys that may denote a number are interpreted as such, all others are interpreted as strings.”h]”hI)�”}”(hjÿh]”hŒàTo be able to use JSON-like syntax in configuring JavaScript libraries, Transcrypt dicts are in fact JavaScript objects. Attribute keys that may denote a number are interpreted as such, all others are interpreted as strings.”…”�”}”(hjÿhjubah}”(h ]”h"]”h$]”h&]”h(]”uh*hHhh+hKhjýubah}”(h ]”h"]”h$]”h&]”h(]”uh*hBhjãhhhh+hNubhC)�”}”(hŒŠAny amount of literal JavaScript can be included in-line or from a separate file using :ref:`\_\_pragma\_\_ ('js', ..., ...) `.”h]”hI)�”}”(hjh]”(hŒWAny amount of literal JavaScript can be included in-line or from a separate file using ”…”�”}”(hŒWAny amount of literal JavaScript can be included in-line or from a separate file using ”hjubhj)�”}”(hŒ2:ref:`\_\_pragma\_\_ ('js', ..., ...) `”h]”hp)�”}”(hj"h]”hŒ__pragma__ (‘js’, …, …)”…”�”}”(hhhj$ubah}”(h ]”h"]”(h{Œstd”Œstd-ref”eh$]”h&]”h(]”uh*hohj ubah}”(h ]”h"]”h$]”h&]”h(]”Œrefdoc”hˆŒ refdomain”j.Œreftype”Œref”Œ refexplicit”ˆŒrefwarn”ˆhŽŒ pragma_js”uh*hihh+hKhjubhŒ.”…”�”}”(hh”hjubeh}”(h ]”h"]”h$]”h&]”h(]”uh*hHhh+hKhjubah}”(h ]”h"]”h$]”h&]”h(]”uh*hBhjãhhhh+hNubhC)�”}”(hŒUThe *print* function can be used to print to a DOM element or to the browser console.”h]”hI)�”}”(hjRh]”(hŒThe ”…”�”}”(hŒThe ”hjTubjF)�”}”(hŒ*print*”h]”hŒprint”…”�”}”(hhhj\ubah}”(h ]”h"]”h$]”h&]”h(]”uh*jEhjTubhŒJ function can be used to print to a DOM element or to the browser console.”…”�”}”(hŒJ function can be used to print to a DOM element or to the browser console.”hjTubeh}”(h ]”h"]”h$]”h&]”h(]”uh*hHhh+hKhjPubah}”(h ]”h"]”h$]”h&]”h(]”uh*hBhjãhhhh+hNubhC)�”}”(hŒ·The methods *console.dir* and *console.log* are also available when programming for the browser, as are in fact all JavaScript facilities, including the complete DOM-manipulation API.”h]”hI)�”}”(hj}h]”(hŒ The methods ”…”�”}”(hŒ The methods ”hjubjF)�”}”(hŒ *console.dir*”h]”hŒ console.dir”…”�”}”(hhhj‡ubah}”(h ]”h"]”h$]”h&]”h(]”uh*jEhjubhŒ and ”…”�”}”(hŒ and ”hjubjF)�”}”(hŒ *console.log*”h]”hŒ console.log”…”�”}”(hhhjšubah}”(h ]”h"]”h$]”h&]”h(]”uh*jEhjubhŒŒ are also available when programming for the browser, as are in fact all JavaScript facilities, including the complete DOM-manipulation API.”…”�”}”(hŒŒ are also available when programming for the browser, as are in fact all JavaScript facilities, including the complete DOM-manipulation API.”hjubeh}”(h ]”h"]”h$]”h&]”h(]”uh*hHhh+hKhj{ubah}”(h ]”h"]”h$]”h&]”h(]”uh*hBhjãhhhh+hNubhC)�”}”(hXCertain identifiers are reserved in JavaScript. In most cases they still can be used in Transcrypt, since they are aliased to other identifiers. Identifiers and directory keys starting with *py\_* are to be avoided, since many of them have special meaning in Transcrypt. It would have been possible to make clashes even more rare, by using e.g. @ and \_\_ in but this would have made the JavaScript code harder to read. Note that you can define a local alias yourself if you still want to use a reserved identifier.”h]”hI)�”}”(hj»h]”(hŒ¾Certain identifiers are reserved in JavaScript. In most cases they still can be used in Transcrypt, since they are aliased to other identifiers. Identifiers and directory keys starting with ”…”�”}”(hŒ¾Certain identifiers are reserved in JavaScript. In most cases they still can be used in Transcrypt, since they are aliased to other identifiers. Identifiers and directory keys starting with ”hj½ubjF)�”}”(hŒ*py\_*”h]”hŒpy_”…”�”}”(hhhjÅubah}”(h ]”h"]”h$]”h&]”h(]”uh*jEhj½ubhX? are to be avoided, since many of them have special meaning in Transcrypt. It would have been possible to make clashes even more rare, by using e.g. @ and __ in but this would have made the JavaScript code harder to read. Note that you can define a local alias yourself if you still want to use a reserved identifier.”…”�”}”(hX? are to be avoided, since many of them have special meaning in Transcrypt. It would have been possible to make clashes even more rare, by using e.g. @ and \_\_ in but this would have made the JavaScript code harder to read. Note that you can define a local alias yourself if you still want to use a reserved identifier.”hj½ubeh}”(h ]”h"]”h$]”h&]”h(]”uh*hHhh+hK hj¹ubah}”(h ]”h"]”h$]”h&]”h(]”uh*hBhjãhhhh+hNubhC)�”}”(hŒ9The name *type* cannot be used as an ordinary identifier.”h]”hI)�”}”(hjæh]”(hŒ The name ”…”�”}”(hŒ The name ”hjèubjF)�”}”(hŒ*type*”h]”hŒtype”…”�”}”(hhhjðubah}”(h ]”h"]”h$]”h&]”h(]”uh*jEhjèubhŒ* cannot be used as an ordinary identifier.”…”�”}”(hŒ* cannot be used as an ordinary identifier.”hjèubeh}”(h ]”h"]”h$]”h&]”h(]”uh*hHhh+hK!hjäubah}”(h ]”h"]”h$]”h&]”h(]”uh*hBhjãhhhh+hNubhC)�”}”(hŒoYou can use *require* to load JavaScript modules on the fly and access them just as you would from JavaScript. ”h]”hI)�”}”(hŒnYou can use *require* to load JavaScript modules on the fly and access them just as you would from JavaScript.”h]”(hŒ You can use ”…”�”}”(hŒ You can use ”hjubjF)�”}”(hŒ *require*”h]”hŒrequire”…”�”}”(hhhjubah}”(h ]”h"]”h$]”h&]”h(]”uh*jEhjubhŒY to load JavaScript modules on the fly and access them just as you would from JavaScript.”…”�”}”(hŒY to load JavaScript modules on the fly and access them just as you would from JavaScript.”hjubeh}”(h ]”h"]”h$]”h&]”h(]”uh*hHhh+hK"hjubah}”(h ]”h"]”h$]”h&]”h(]”uh*hBhjãhhhh+hNubeh}”(h ]”h"]”h$]”h&]”h(]”híhîuh*h=hh+hKhjÒhhubeh}”(h ]”ŒLdifferences-due-to-interoperability-with-javascript-and-javascript-libraries”ah"]”h$]”ŒLdifferences due to interoperability with javascript and javascript libraries”ah&]”h(]”uh*h hh hhhh+hKubh )�”}”(hhh]”(h)�”}”(hŒ]Differences due to running Transcrypt applications in the browser, rather than on the desktop”h]”hŒ]Differences due to running Transcrypt applications in the browser, rather than on the desktop”…”�”}”(hjNhjLhhhNhNubah}”(h ]”h"]”h$]”h&]”h(]”uh*hhjIhhhh+hK%ubh>)�”}”(hhh]”(hC)�”}”(hŒªTranscrypt doesn't directly support the use of libraries written in C or C++ since, without special measures like compiling to asm.js, C and C++ don't run in the browser.”h]”hI)�”}”(hj_h]”hŒ®Transcrypt doesn’t directly support the use of libraries written in C or C++ since, without special measures like compiling to asm.js, C and C++ don’t run in the browser.”…”�”}”(hj_hjaubah}”(h ]”h"]”h$]”h&]”h(]”uh*hHhh+hK'hj]ubah}”(h ]”h"]”h$]”h&]”h(]”uh*hBhjZhhhh+hNubhC)�”}”(hŒ|The browser programming model is event driven, so Transcrypt programs are even driven, as are their JavaScript counterparts.”h]”hI)�”}”(hjvh]”hŒ|The browser programming model is event driven, so Transcrypt programs are even driven, as are their JavaScript counterparts.”…”�”}”(hjvhjxubah}”(h ]”h"]”h$]”h&]”h(]”uh*hHhh+hK(hjtubah}”(h ]”h"]”h$]”h&]”h(]”uh*hBhjZhhhh+hNubhC)�”}”(hŒÏJust like JavaScript, Transcrypt running in the browser cannot write to an ordinary disk file, due to security limitations. However, just like JavaScript, it can store and retrieve data using JSON and Ajax. ”h]”hI)�”}”(hŒÎJust like JavaScript, Transcrypt running in the browser cannot write to an ordinary disk file, due to security limitations. However, just like JavaScript, it can store and retrieve data using JSON and Ajax.”h]”hŒÎJust like JavaScript, Transcrypt running in the browser cannot write to an ordinary disk file, due to security limitations. However, just like JavaScript, it can store and retrieve data using JSON and Ajax.”…”�”}”(hj‘hj�ubah}”(h ]”h"]”h$]”h&]”h(]”uh*hHhh+hK)hj‹ubah}”(h ]”h"]”h$]”h&]”h(]”uh*hBhjZhhhh+hNubeh}”(h ]”h"]”h$]”h&]”h(]”híhîuh*h=hh+hK'hjIhhubeh}”(h ]”Œ\differences-due-to-running-transcrypt-applications-in-the-browser-rather-than-on-the-desktop”ah"]”h$]”Œ]differences due to running transcrypt applications in the browser, rather than on the desktop”ah&]”h(]”uh*h hh hhhh+hK%ubeh}”(h ]”Œ!the-main-differences-with-cpython”ah"]”h$]”Œ!the main differences with cpython”ah&]”h(]”uh*h hhhhhh+hKubah}”(h ]”h"]”h$]”h&]”h(]”Œsource”h+uh*hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)�”}”(hNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”jÜŒerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”h+Œ _destination”NŒ _config_files”]”Œpep_references”NŒ pep_base_url”Œ https://www.python.org/dev/peps/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œhttps://tools.ietf.org/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œfile_insertion_enabled”ˆŒ raw_enabled”KŒsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(j¶j³hôhñjÏjÌjFjCj®j«uŒ nametypes”}”(j¶NhôNjÏNjFNj®Nuh }”(j³h hñh,jÌh÷jCjÒj«jIuŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ decoration”Nhhub.