sku-pg
Version:
Skulpt is a Javascript implementation of Python 2.x. Python that runs in your browser!
2,586 lines • 33.6 kB
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Namespace: builtin</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Namespace: builtin</h1>
<section>
<header>
<h2>
<span class="ancestors"><a href="Sk.html">Sk</a>.</span>
builtin
</h2>
</header>
<article>
<div class="container-overview">
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="function.js.html">function.js</a>, <a href="function.js.html#line1">line 1</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Classes</h3>
<dl>
<dt><a href="Sk.builtin.bool.html">bool</a></dt>
<dd></dd>
<dt><a href="Sk.builtin.float_.html">float_</a></dt>
<dd></dd>
<dt><a href="Sk.builtin.func.html">func</a></dt>
<dd></dd>
<dt><a href="Sk.builtin.int_.html">int_</a></dt>
<dd></dd>
<dt><a href="Sk.builtin.none.html">none</a></dt>
<dd></dd>
<dt><a href="Sk.builtin.NotImplemented.html">NotImplemented</a></dt>
<dd></dd>
<dt><a href="Sk.builtin.numtype.html">numtype</a></dt>
<dd></dd>
<dt><a href="Sk.builtin.object.html">object</a></dt>
<dd></dd>
<dt><a href="Sk.builtin.seqtype.html">seqtype</a></dt>
<dd></dd>
</dl>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id=".checkComplex"><span class="type-signature">(static) </span>checkComplex<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Checks for complex type, delegates to internal method
Most skulpt users would search here!</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="function.js.html">function.js</a>, <a href="function.js.html#line116">line 116</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".checkIterable"><span class="type-signature">(static) </span>checkIterable<span class="signature">(arg)</span><span class="type-signature"> → {boolean}</span></h4>
<div class="description">
<p>Use this to test whether or not a Python object is iterable. You should <strong>not</strong> rely
on the presence of tp$iter on the object as a good test, as it could be a user defined
class with <code>__iter__</code> defined or <code>__getitem__</code> This tests for all of those cases</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>arg</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>A Python object</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="function.js.html">function.js</a>, <a href="function.js.html#line74">line 74</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>true if the object is iterable</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">boolean</span>
</dd>
</dl>
<h4 class="name" id=".pyCheckArgs"><span class="type-signature">(static) </span>pyCheckArgs<span class="signature">(name, args, minargs, maxargs<span class="signature-attributes">opt</span>, kwargs<span class="signature-attributes">opt</span>, free<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Check arguments to Python functions to ensure the correct number of
arguments are passed.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>the name of the function</p></td>
</tr>
<tr>
<td class="name"><code>args</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>the args passed to the function</p></td>
</tr>
<tr>
<td class="name"><code>minargs</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>the minimum number of allowable arguments</p></td>
</tr>
<tr>
<td class="name"><code>maxargs</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>optional maximum number of allowable
arguments (default: Infinity)</p></td>
</tr>
<tr>
<td class="name"><code>kwargs</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>optional true if kwargs, false otherwise
(default: false)</p></td>
</tr>
<tr>
<td class="name"><code>free</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>optional true if free vars, false otherwise
(default: false)</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="function.js.html">function.js</a>, <a href="function.js.html#line20">line 20</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".pyCheckType"><span class="type-signature">(static) </span>pyCheckType<span class="signature">(name, exptype, check)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Check type of argument to Python functions.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>the name of the argument</p></td>
</tr>
<tr>
<td class="name"><code>exptype</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>string of the expected type name</p></td>
</tr>
<tr>
<td class="name"><code>check</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last"><p>truthy if type check passes, falsy otherwise</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="function.js.html">function.js</a>, <a href="function.js.html#line54">line 54</a>
</li></ul></dd>
</dl>
</article>
</section>
<section>
<header>
<h2>
<span class="ancestors"><a href="Sk.html">Sk</a>.</span>
builtin
</h2>
</header>
<article>
<div class="container-overview">
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="int.js.html">int.js</a>, <a href="int.js.html#line4">line 4</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Classes</h3>
<dl>
<dt><a href="Sk.builtin.bool.html">bool</a></dt>
<dd></dd>
<dt><a href="Sk.builtin.float_.html">float_</a></dt>
<dd></dd>
<dt><a href="Sk.builtin.func.html">func</a></dt>
<dd></dd>
<dt><a href="Sk.builtin.int_.html">int_</a></dt>
<dd></dd>
<dt><a href="Sk.builtin.none.html">none</a></dt>
<dd></dd>
<dt><a href="Sk.builtin.NotImplemented.html">NotImplemented</a></dt>
<dd></dd>
<dt><a href="Sk.builtin.numtype.html">numtype</a></dt>
<dd></dd>
<dt><a href="Sk.builtin.object.html">object</a></dt>
<dd></dd>
<dt><a href="Sk.builtin.seqtype.html">seqtype</a></dt>
<dd></dd>
</dl>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id=".checkComplex"><span class="type-signature">(static) </span>checkComplex<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Checks for complex type, delegates to internal method
Most skulpt users would search here!</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="function.js.html">function.js</a>, <a href="function.js.html#line116">line 116</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".checkIterable"><span class="type-signature">(static) </span>checkIterable<span class="signature">(arg)</span><span class="type-signature"> → {boolean}</span></h4>
<div class="description">
<p>Use this to test whether or not a Python object is iterable. You should <strong>not</strong> rely
on the presence of tp$iter on the object as a good test, as it could be a user defined
class with <code>__iter__</code> defined or <code>__getitem__</code> This tests for all of those cases</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>arg</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>A Python object</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="function.js.html">function.js</a>, <a href="function.js.html#line74">line 74</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>true if the object is iterable</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">boolean</span>
</dd>
</dl>
<h4 class="name" id=".pyCheckArgs"><span class="type-signature">(static) </span>pyCheckArgs<span class="signature">(name, args, minargs, maxargs<span class="signature-attributes">opt</span>, kwargs<span class="signature-attributes">opt</span>, free<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Check arguments to Python functions to ensure the correct number of
arguments are passed.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>the name of the function</p></td>
</tr>
<tr>
<td class="name"><code>args</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>the args passed to the function</p></td>
</tr>
<tr>
<td class="name"><code>minargs</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>the minimum number of allowable arguments</p></td>
</tr>
<tr>
<td class="name"><code>maxargs</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>optional maximum number of allowable
arguments (default: Infinity)</p></td>
</tr>
<tr>
<td class="name"><code>kwargs</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>optional true if kwargs, false otherwise
(default: false)</p></td>
</tr>
<tr>
<td class="name"><code>free</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>optional true if free vars, false otherwise
(default: false)</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="function.js.html">function.js</a>, <a href="function.js.html#line20">line 20</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".pyCheckType"><span class="type-signature">(static) </span>pyCheckType<span class="signature">(name, exptype, check)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Check type of argument to Python functions.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>the name of the argument</p></td>
</tr>
<tr>
<td class="name"><code>exptype</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>string of the expected type name</p></td>
</tr>
<tr>
<td class="name"><code>check</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last"><p>truthy if type check passes, falsy otherwise</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="function.js.html">function.js</a>, <a href="function.js.html#line54">line 54</a>
</li></ul></dd>
</dl>
</article>
</section>
<section>
<header>
<h2>
<span class="ancestors"><a href="Sk.html">Sk</a>.</span>
builtin
</h2>
</header>
<article>
<div class="container-overview">
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="float.js.html">float.js</a>, <a href="float.js.html#line1">line 1</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Classes</h3>
<dl>
<dt><a href="Sk.builtin.bool.html">bool</a></dt>
<dd></dd>
<dt><a href="Sk.builtin.float_.html">float_</a></dt>
<dd></dd>
<dt><a href="Sk.builtin.func.html">func</a></dt>
<dd></dd>
<dt><a href="Sk.builtin.int_.html">int_</a></dt>
<dd></dd>
<dt><a href="Sk.builtin.none.html">none</a></dt>
<dd></dd>
<dt><a href="Sk.builtin.NotImplemented.html">NotImplemented</a></dt>
<dd></dd>
<dt><a href="Sk.builtin.numtype.html">numtype</a></dt>
<dd></dd>
<dt><a href="Sk.builtin.object.html">object</a></dt>
<dd></dd>
<dt><a href="Sk.builtin.seqtype.html">seqtype</a></dt>
<dd></dd>
</dl>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id=".checkComplex"><span class="type-signature">(static) </span>checkComplex<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Checks for complex type, delegates to internal method
Most skulpt users would search here!</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="function.js.html">function.js</a>, <a href="function.js.html#line116">line 116</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".checkIterable"><span class="type-signature">(static) </span>checkIterable<span class="signature">(arg)</span><span class="type-signature"> → {boolean}</span></h4>
<div class="description">
<p>Use this to test whether or not a Python object is iterable. You should <strong>not</strong> rely
on the presence of tp$iter on the object as a good test, as it could be a user defined
class with <code>__iter__</code> defined or <code>__getitem__</code> This tests for all of those cases</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>arg</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last"><p>A Python object</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="function.js.html">function.js</a>, <a href="function.js.html#line74">line 74</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>true if the object is iterable</p>
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">boolean</span>
</dd>
</dl>
<h4 class="name" id=".pyCheckArgs"><span class="type-signature">(static) </span>pyCheckArgs<span class="signature">(name, args, minargs, maxargs<span class="signature-attributes">opt</span>, kwargs<span class="signature-attributes">opt</span>, free<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Check arguments to Python functions to ensure the correct number of
arguments are passed.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>the name of the function</p></td>
</tr>
<tr>
<td class="name"><code>args</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>the args passed to the function</p></td>
</tr>
<tr>
<td class="name"><code>minargs</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
</td>
<td class="description last"><p>the minimum number of allowable arguments</p></td>
</tr>
<tr>
<td class="name"><code>maxargs</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>optional maximum number of allowable
arguments (default: Infinity)</p></td>
</tr>
<tr>
<td class="name"><code>kwargs</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>optional true if kwargs, false otherwise
(default: false)</p></td>
</tr>
<tr>
<td class="name"><code>free</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
<optional><br>
</td>
<td class="description last"><p>optional true if free vars, false otherwise
(default: false)</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="function.js.html">function.js</a>, <a href="function.js.html#line20">line 20</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".pyCheckType"><span class="type-signature">(static) </span>pyCheckType<span class="signature">(name, exptype, check)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Check type of argument to Python functions.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>the name of the argument</p></td>
</tr>
<tr>
<td class="name"><code>exptype</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last"><p>string of the expected type name</p></td>
</tr>
<tr>
<td class="name"><code>check</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last"><p>truthy if type check passes, falsy otherwise</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="function.js.html">function.js</a>, <a href="function.js.html#line54">line 54</a>
</li></ul></dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Sk.abstr.iter-seqIter.html">seqIter</a></li><li><a href="Sk.builtin.bool.html">bool</a></li><li><a href="Sk.builtin.float_.html">float_</a></li><li><a href="Sk.builtin.func.html">func</a></li><li><a href="Sk.builtin.int_.html">int_</a></li><li><a href="Sk.builtin.none.html">none</a></li><li><a href="Sk.builtin.NotImplemented.html">NotImplemented</a></li><li><a href="Sk.builtin.numtype.html">numtype</a></li><li><a href="Sk.builtin.object.html">object</a></li><li><a href="Sk.builtin.seqtype.html">seqtype</a></li><li><a href="Sk.misceval.Suspension.html">Suspension</a></li></ul><h3>Namespaces</h3><ul><li><a href="Sk.html">Sk</a></li><li><a href="Sk.abstr.html">abstr</a></li><li><a href="Sk.builtin.html">builtin</a></li><li><a href="Sk.ffi.html">ffi</a></li><li><a href="Sk.misceval.html">misceval</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.0</a> on Thu Aug 13 2015 08:14:27 GMT-0500 (CDT)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>