Skip to content
This repository

add Integer traitlet #996

Closed
wants to merge 1 commit into from

3 participants

Min RK Thomas Kluyver Fernando Perez
Min RK
Owner

Most Int traits are now Integers

Integer differs from Long only in that small longs are cast to int, rather than
all ints being cast to long:

Integer(4L) => 4
Long(4) => 4L

closes gh-942

Min RK add Integer traitlet
Most int traits are now Integers

Integer differs from Long only in that small `long`s are cast to `int`, rather than
all `int`s being cast to `long`:

    Integer(4L) => 4
    Long(4) => 4L

closes gh-942
cfee6c0
Thomas Kluyver
Collaborator

Looks OK to me. I haven't tested in Python 3, but from what I know 2to3 does, it should work (it just becomes effectively the same as Int).

Min RK
Owner

The Integer traitlet is defined inside the same if not py3compat.PY3 block as Long, so Int is Integer on Python 3.

Thomas Kluyver
Collaborator
Fernando Perez fperez closed this November 19, 2011
Fernando Perez
Owner

Looks good. Rebased and merged in 293d3ee. Thanks!

Stefan van der Walt stefanv referenced this pull request from a commit in stefanv/ipython November 01, 2011
Min RK add Integer traitlet
Most int traits are now Integers

Integer differs from Long only in that small `long`s are cast to `int`, rather than
all `int`s being cast to `long`:

    Integer(4L) => 4
    Long(4) => 4L

closes gh-942, closes gh-996.

Rebased to avoid recursive merge for just one commit.
293d3ee
Fernando Perez fperez referenced this pull request from a commit January 10, 2012
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Nov 13, 2011
Min RK add Integer traitlet
Most int traits are now Integers

Integer differs from Long only in that small `long`s are cast to `int`, rather than
all `int`s being cast to `long`:

    Integer(4L) => 4
    Long(4) => 4L

closes gh-942
cfee6c0
This page is out of date. Refresh to see the latest.

Showing 28 changed files with 183 additions and 127 deletions. Show diff stats Hide diff stats

  1. 2  IPython/config/application.py
  2. 8  IPython/config/tests/test_application.py
  3. 10  IPython/config/tests/test_configurable.py
  4. 2  IPython/config/tests/test_loader.py
  5. 4  IPython/core/formatters.py
  6. 6  IPython/core/history.py
  7. 8  IPython/core/interactiveshell.py
  8. 36  IPython/core/prefilter.py
  9. 4  IPython/frontend/html/notebook/kernelmanager.py
  10. 4  IPython/frontend/html/notebook/notebookapp.py
  11. 6  IPython/frontend/qt/console/console_widget.py
  12. 10  IPython/frontend/qt/console/qtconsoleapp.py
  13. 4  IPython/frontend/terminal/interactiveshell.py
  14. 8  IPython/parallel/apps/ipclusterapp.py
  15. 10  IPython/parallel/apps/launcher.py
  16. 50  IPython/parallel/apps/winhpcjob.py
  17. 6  IPython/parallel/client/client.py
  18. 6  IPython/parallel/client/view.py
  19. 22  IPython/parallel/controller/hub.py
  20. 4  IPython/parallel/controller/scheduler.py
  21. 4  IPython/parallel/engine/engine.py
  22. 4  IPython/parallel/engine/streamkernel.py
  23. 4  IPython/parallel/factory.py
  24. 39  IPython/utils/tests/test_traitlets.py
  25. 23  IPython/utils/traitlets.py
  26. 2  IPython/zmq/ipkernel.py
  27. 14  IPython/zmq/kernelapp.py
  28. 10  IPython/zmq/kernelmanager.py
2  IPython/config/application.py
@@ -34,7 +34,7 @@
34 34
 )
35 35
 
36 36
 from IPython.utils.traitlets import (
37  
-    Unicode, List, Int, Enum, Dict, Instance, TraitError
  37
+    Unicode, List, Enum, Dict, Instance, TraitError
38 38
 )
39 39
 from IPython.utils.importstring import import_item
40 40
 from IPython.utils.text import indent, wrap_paragraphs, dedent
8  IPython/config/tests/test_application.py
@@ -28,7 +28,7 @@
28 28
 )
29 29
 
30 30
 from IPython.utils.traitlets import (
31  
-    Bool, Unicode, Int, Float, List, Dict
  31
+    Bool, Unicode, Integer, Float, List, Dict
32 32
 )
33 33
 
34 34
 #-----------------------------------------------------------------------------
@@ -37,14 +37,14 @@
37 37
 
38 38
 class Foo(Configurable):
39 39
 
40  
-    i = Int(0, config=True, help="The integer i.")
41  
-    j = Int(1, config=True, help="The integer j.")
  40
+    i = Integer(0, config=True, help="The integer i.")
  41
+    j = Integer(1, config=True, help="The integer j.")
42 42
     name = Unicode(u'Brian', config=True, help="First name.")
43 43
 
44 44
 
45 45
 class Bar(Configurable):
46 46
 
47  
-    b = Int(0, config=True, help="The integer b.")
  47
+    b = Integer(0, config=True, help="The integer b.")
48 48
     enabled = Bool(True, config=True, help="Enable bar.")
49 49
 
50 50
 
10  IPython/config/tests/test_configurable.py
@@ -27,7 +27,7 @@
27 27
 )
28 28
 
29 29
 from IPython.utils.traitlets import (
30  
-    Int, Float, Unicode
  30
+    Integer, Float, Unicode
31 31
 )
32 32
 
33 33
 from IPython.config.loader import Config
@@ -39,14 +39,14 @@
39 39
 
40 40
 
41 41
 class MyConfigurable(Configurable):
42  
-    a = Int(1, config=True, help="The integer a.")
  42
+    a = Integer(1, config=True, help="The integer a.")
43 43
     b = Float(1.0, config=True, help="The integer b.")
44 44
     c = Unicode('no config')
45 45
 
46 46
 
47 47
 mc_help=u"""MyConfigurable options
48 48
 ----------------------
49  
---MyConfigurable.a=<Int>
  49
+--MyConfigurable.a=<Integer>
50 50
     Default: 1
51 51
     The integer a.
52 52
 --MyConfigurable.b=<Float>
@@ -55,7 +55,7 @@ class MyConfigurable(Configurable):
55 55
 
56 56
 mc_help_inst=u"""MyConfigurable options
57 57
 ----------------------
58  
---MyConfigurable.a=<Int>
  58
+--MyConfigurable.a=<Integer>
59 59
     Current: 5
60 60
     The integer a.
61 61
 --MyConfigurable.b=<Float>
@@ -63,7 +63,7 @@ class MyConfigurable(Configurable):
63 63
     The integer b."""
64 64
 
65 65
 class Foo(Configurable):
66  
-    a = Int(0, config=True, help="The integer a.")
  66
+    a = Integer(0, config=True, help="The integer a.")
67 67
     b = Unicode('nope', config=True)
68 68
 
69 69
 
2  IPython/config/tests/test_loader.py
@@ -28,7 +28,7 @@
28 28
 
29 29
 from IPython.testing.tools import mute_warn
30 30
 
31  
-from IPython.utils.traitlets import Int, Unicode
  31
+from IPython.utils.traitlets import Unicode
32 32
 from IPython.config.configurable import Configurable
33 33
 from IPython.config.loader import (
34 34
     Config,
4  IPython/core/formatters.py
@@ -28,7 +28,7 @@
28 28
 # Our own imports
29 29
 from IPython.config.configurable import Configurable
30 30
 from IPython.lib import pretty
31  
-from IPython.utils.traitlets import Bool, Dict, Int, Unicode, CUnicode, ObjectName
  31
+from IPython.utils.traitlets import Bool, Dict, Integer, Unicode, CUnicode, ObjectName
32 32
 from IPython.utils.py3compat import unicode_to_str
33 33
 
34 34
 
@@ -357,7 +357,7 @@ def dtype_pprinter(obj, p, cycle):
357 357
     verbose = Bool(False, config=True)
358 358
 
359 359
     # The maximum width.
360  
-    max_width = Int(79, config=True)
  360
+    max_width = Integer(79, config=True)
361 361
 
362 362
     # The newline character.
363 363
     newline = Unicode('\n', config=True)
6  IPython/core/history.py
@@ -29,7 +29,7 @@
29 29
 from IPython.testing.skipdoctest import skip_doctest
30 30
 from IPython.utils import io
31 31
 from IPython.utils.path import locate_profile
32  
-from IPython.utils.traitlets import Bool, Dict, Instance, Int, CInt, List, Unicode
  32
+from IPython.utils.traitlets import Bool, Dict, Instance, Integer, List, Unicode
33 33
 from IPython.utils.warn import warn
34 34
 
35 35
 #-----------------------------------------------------------------------------
@@ -361,12 +361,12 @@ def _dir_hist_default(self):
361 361
     output_hist_reprs = Dict()
362 362
 
363 363
     # The number of the current session in the history database
364  
-    session_number = CInt()
  364
+    session_number = Integer()
365 365
     # Should we log output to the database? (default no)
366 366
     db_log_output = Bool(False, config=True)
367 367
     # Write to database every x commands (higher values save disk access & power)
368 368
     #  Values of 1 or less effectively disable caching. 
369  
-    db_cache_size = Int(0, config=True)
  369
+    db_cache_size = Integer(0, config=True)
370 370
     # The input and output caches
371 371
     db_input_cache = List()
372 372
     db_output_cache = List()
8  IPython/core/interactiveshell.py
@@ -74,7 +74,7 @@
74 74
 from IPython.utils.strdispatch import StrDispatch
75 75
 from IPython.utils.syspathcontext import prepended_to_syspath
76 76
 from IPython.utils.text import num_ini_spaces, format_screen, LSString, SList
77  
-from IPython.utils.traitlets import (Int, CBool, CaselessStrEnum, Enum,
  77
+from IPython.utils.traitlets import (Integer, CBool, CaselessStrEnum, Enum,
78 78
                                      List, Unicode, Instance, Type)
79 79
 from IPython.utils.warn import warn, error, fatal
80 80
 import IPython.core.hooks
@@ -226,7 +226,7 @@ class InteractiveShell(SingletonConfigurable, Magic):
226 226
         Enable magic commands to be called without the leading %.
227 227
         """
228 228
     )
229  
-    cache_size = Int(1000, config=True, help=
  229
+    cache_size = Integer(1000, config=True, help=
230 230
         """
231 231
         Set the size of the output cache.  The default is 1000, you can
232 232
         change it permanently in your config file.  Setting it to 0 completely
@@ -277,7 +277,7 @@ class InteractiveShell(SingletonConfigurable, Magic):
277 277
     def _exiter_default(self):
278 278
         return ExitAutocall(self)
279 279
     # Monotonically increasing execution counter
280  
-    execution_count = Int(1)
  280
+    execution_count = Integer(1)
281 281
     filename = Unicode("<ipython console>")
282 282
     ipython_dir= Unicode('', config=True) # Set to get_ipython_dir() in __init__
283 283
 
@@ -317,7 +317,7 @@ def _exiter_default(self):
317 317
     prompts_pad_left = CBool(True, config=True)
318 318
     quiet = CBool(False, config=True)
319 319
 
320  
-    history_length = Int(10000, config=True)
  320
+    history_length = Integer(10000, config=True)
321 321
 
322 322
     # The readline stuff will eventually be moved to the terminal subclass
323 323
     # but for now, we can't do that as readline is welded in everywhere.
36  IPython/core/prefilter.py
@@ -35,7 +35,7 @@
35 35
 from IPython.core.splitinput import split_user_input, LineInfo
36 36
 from IPython.core import page
37 37
 
38  
-from IPython.utils.traitlets import List, Int, Any, Unicode, CBool, Bool, Instance
  38
+from IPython.utils.traitlets import List, Integer, Any, Unicode, CBool, Bool, Instance
39 39
 from IPython.utils.text import make_quoted_expr
40 40
 from IPython.utils.autoattr import auto_attr
41 41
 
@@ -369,7 +369,7 @@ def prefilter_lines(self, lines, continue_prompt=False):
369 369
 class PrefilterTransformer(Configurable):
370 370
     """Transform a line of user input."""
371 371
 
372  
-    priority = Int(100, config=True)
  372
+    priority = Integer(100, config=True)
373 373
     # Transformers don't currently use shell or prefilter_manager, but as we
374 374
     # move away from checkers and handlers, they will need them.
375 375
     shell = Instance('IPython.core.interactiveshell.InteractiveShellABC')
@@ -398,7 +398,7 @@ def __repr__(self):
398 398
 class AssignSystemTransformer(PrefilterTransformer):
399 399
     """Handle the `files = !ls` syntax."""
400 400
 
401  
-    priority = Int(100, config=True)
  401
+    priority = Integer(100, config=True)
402 402
 
403 403
     def transform(self, line, continue_prompt):
404 404
         m = _assign_system_re.match(line)
@@ -417,7 +417,7 @@ def transform(self, line, continue_prompt):
417 417
 class AssignMagicTransformer(PrefilterTransformer):
418 418
     """Handle the `a = %who` syntax."""
419 419
 
420  
-    priority = Int(200, config=True)
  420
+    priority = Integer(200, config=True)
421 421
 
422 422
     def transform(self, line, continue_prompt):
423 423
         m = _assign_magic_re.match(line)
@@ -435,7 +435,7 @@ def transform(self, line, continue_prompt):
435 435
 class PyPromptTransformer(PrefilterTransformer):
436 436
     """Handle inputs that start with '>>> ' syntax."""
437 437
 
438  
-    priority = Int(50, config=True)
  438
+    priority = Integer(50, config=True)
439 439
 
440 440
     def transform(self, line, continue_prompt):
441 441
 
@@ -456,7 +456,7 @@ def transform(self, line, continue_prompt):
456 456
 class IPyPromptTransformer(PrefilterTransformer):
457 457
     """Handle inputs that start classic IPython prompt syntax."""
458 458
 
459  
-    priority = Int(50, config=True)
  459
+    priority = Integer(50, config=True)
460 460
 
461 461
     def transform(self, line, continue_prompt):
462 462
 
@@ -479,7 +479,7 @@ def transform(self, line, continue_prompt):
479 479
 class PrefilterChecker(Configurable):
480 480
     """Inspect an input line and return a handler for that line."""
481 481
 
482  
-    priority = Int(100, config=True)
  482
+    priority = Integer(100, config=True)
483 483
     shell = Instance('IPython.core.interactiveshell.InteractiveShellABC')
484 484
     prefilter_manager = Instance('IPython.core.prefilter.PrefilterManager')
485 485
     enabled = Bool(True, config=True)
@@ -501,7 +501,7 @@ def __repr__(self):
501 501
 
502 502
 class EmacsChecker(PrefilterChecker):
503 503
 
504  
-    priority = Int(100, config=True)
  504
+    priority = Integer(100, config=True)
505 505
     enabled = Bool(False, config=True)
506 506
 
507 507
     def check(self, line_info):
@@ -514,7 +514,7 @@ def check(self, line_info):
514 514
 
515 515
 class ShellEscapeChecker(PrefilterChecker):
516 516
 
517  
-    priority = Int(200, config=True)
  517
+    priority = Integer(200, config=True)
518 518
 
519 519
     def check(self, line_info):
520 520
         if line_info.line.lstrip().startswith(ESC_SHELL):
@@ -523,7 +523,7 @@ def check(self, line_info):
523 523
 
524 524
 class MacroChecker(PrefilterChecker):
525 525
 
526  
-    priority = Int(250, config=True)
  526
+    priority = Integer(250, config=True)
527 527
 
528 528
     def check(self, line_info):
529 529
         obj = self.shell.user_ns.get(line_info.ifun)
@@ -535,7 +535,7 @@ def check(self, line_info):
535 535
 
536 536
 class IPyAutocallChecker(PrefilterChecker):
537 537
 
538  
-    priority = Int(300, config=True)
  538
+    priority = Integer(300, config=True)
539 539
 
540 540
     def check(self, line_info):
541 541
         "Instances of IPyAutocall in user_ns get autocalled immediately"
@@ -549,7 +549,7 @@ def check(self, line_info):
549 549
 
550 550
 class MultiLineMagicChecker(PrefilterChecker):
551 551
 
552  
-    priority = Int(400, config=True)
  552
+    priority = Integer(400, config=True)
553 553
 
554 554
     def check(self, line_info):
555 555
         "Allow ! and !! in multi-line statements if multi_line_specials is on"
@@ -566,7 +566,7 @@ def check(self, line_info):
566 566
 
567 567
 class EscCharsChecker(PrefilterChecker):
568 568
 
569  
-    priority = Int(500, config=True)
  569
+    priority = Integer(500, config=True)
570 570
 
571 571
     def check(self, line_info):
572 572
         """Check for escape character and return either a handler to handle it,
@@ -586,7 +586,7 @@ def check(self, line_info):
586 586
 
587 587
 class AssignmentChecker(PrefilterChecker):
588 588
 
589  
-    priority = Int(600, config=True)
  589
+    priority = Integer(600, config=True)
590 590
 
591 591
     def check(self, line_info):
592 592
         """Check to see if user is assigning to a var for the first time, in
@@ -604,7 +604,7 @@ def check(self, line_info):
604 604
 
605 605
 class AutoMagicChecker(PrefilterChecker):
606 606
 
607  
-    priority = Int(700, config=True)
  607
+    priority = Integer(700, config=True)
608 608
 
609 609
     def check(self, line_info):
610 610
         """If the ifun is magic, and automagic is on, run it.  Note: normal,
@@ -628,7 +628,7 @@ def check(self, line_info):
628 628
 
629 629
 class AliasChecker(PrefilterChecker):
630 630
 
631  
-    priority = Int(800, config=True)
  631
+    priority = Integer(800, config=True)
632 632
 
633 633
     def check(self, line_info):
634 634
         "Check if the initital identifier on the line is an alias."
@@ -644,7 +644,7 @@ def check(self, line_info):
644 644
 
645 645
 class PythonOpsChecker(PrefilterChecker):
646 646
 
647  
-    priority = Int(900, config=True)
  647
+    priority = Integer(900, config=True)
648 648
 
649 649
     def check(self, line_info):
650 650
         """If the 'rest' of the line begins with a function call or pretty much
@@ -659,7 +659,7 @@ def check(self, line_info):
659 659
 
660 660
 class AutocallChecker(PrefilterChecker):
661 661
 
662  
-    priority = Int(1000, config=True)
  662
+    priority = Integer(1000, config=True)
663 663
 
664 664
     def check(self, line_info):
665 665
         "Check if the initial word/function is callable and autocall is on."
4  IPython/frontend/html/notebook/kernelmanager.py
@@ -29,7 +29,7 @@
29 29
 from IPython.config.configurable import LoggingConfigurable
30 30
 from IPython.zmq.ipkernel import launch_kernel
31 31
 from IPython.zmq.kernelmanager import KernelManager
32  
-from IPython.utils.traitlets import Instance, Dict, List, Unicode, Float, Int
  32
+from IPython.utils.traitlets import Instance, Dict, List, Unicode, Float, Integer
33 33
 
34 34
 #-----------------------------------------------------------------------------
35 35
 # Classes
@@ -196,7 +196,7 @@ class MappingKernelManager(MultiKernelManager):
196 196
     kernel_argv = List(Unicode)
197 197
     kernel_manager = Instance(KernelManager)
198 198
     time_to_dead = Float(3.0, config=True, help="""Kernel heartbeat interval in seconds.""")
199  
-    max_msg_size = Int(65536, config=True, help="""
  199
+    max_msg_size = Integer(65536, config=True, help="""
200 200
         The max raw message size accepted from the browser
201 201
         over a WebSocket connection.
202 202
     """)
4  IPython/frontend/html/notebook/notebookapp.py
@@ -57,7 +57,7 @@
57 57
     aliases as ipkernel_aliases,
58 58
     IPKernelApp
59 59
 )
60  
-from IPython.utils.traitlets import Dict, Unicode, Int, List, Enum, Bool
  60
+from IPython.utils.traitlets import Dict, Unicode, Integer, List, Enum, Bool
61 61
 
62 62
 #-----------------------------------------------------------------------------
63 63
 # Module globals
@@ -195,7 +195,7 @@ class NotebookApp(BaseIPythonApplication):
195 195
     def _ip_changed(self, name, old, new):
196 196
         if new == u'*': self.ip = u''
197 197
 
198  
-    port = Int(8888, config=True,
  198
+    port = Integer(8888, config=True,
199 199
         help="The port the notebook server will listen on."
200 200
     )
201 201
 
6  IPython/frontend/qt/console/console_widget.py
@@ -20,7 +20,7 @@
20 20
 from IPython.frontend.qt.rich_text import HtmlExporter
21 21
 from IPython.frontend.qt.util import MetaQObjectHasTraits, get_font
22 22
 from IPython.utils.text import columnize
23  
-from IPython.utils.traitlets import Bool, Enum, Int, Unicode
  23
+from IPython.utils.traitlets import Bool, Enum, Integer, Unicode
24 24
 from ansi_code_processor import QtAnsiCodeProcessor
25 25
 from completion_widget import CompletionWidget
26 26
 from kill_ring import QtKillRing
@@ -59,7 +59,7 @@ class ConsoleWidget(LoggingConfigurable, QtGui.QWidget):
59 59
     ansi_codes = Bool(True, config=True,
60 60
         help="Whether to process ANSI escape codes."
61 61
     )
62  
-    buffer_size = Int(500, config=True,
  62
+    buffer_size = Integer(500, config=True,
63 63
         help="""
64 64
         The maximum number of lines of text before truncation. Specifying a
65 65
         non-positive number disables text truncation (not recommended).
@@ -112,7 +112,7 @@ def _font_family_default(self):
112 112
             # Monospace should always exist, no need for a fallback
113 113
             return 'Monospace'
114 114
 
115  
-    font_size = Int(config=True,
  115
+    font_size = Integer(config=True,
116 116
         help="""The font size. If unconfigured, Qt will be entrusted
117 117
         with the size of the font.
118 118
         """)
10  IPython/frontend/qt/console/qtconsoleapp.py
@@ -42,7 +42,7 @@
42 42
 from IPython.utils.path import filefind
43 43
 from IPython.utils.py3compat import str_to_bytes
44 44
 from IPython.utils.traitlets import (
45  
-    Dict, List, Unicode, Int, CaselessStrEnum, CBool, Any
  45
+    Dict, List, Unicode, Integer, CaselessStrEnum, CBool, Any
46 46
 )
47 47
 from IPython.zmq.ipkernel import (
48 48
     flags as ipkernel_flags,
@@ -168,13 +168,13 @@ class IPythonQtConsoleApp(BaseIPythonApplication):
168 168
     sshkey = Unicode('', config=True,
169 169
         help="""Path to the ssh key to use for logging in to the ssh server.""")
170 170
     
171  
-    hb_port = Int(0, config=True,
  171
+    hb_port = Integer(0, config=True,
172 172
         help="set the heartbeat port [default: random]")
173  
-    shell_port = Int(0, config=True,
  173
+    shell_port = Integer(0, config=True,
174 174
         help="set the shell (XREP) port [default: random]")
175  
-    iopub_port = Int(0, config=True,
  175
+    iopub_port = Integer(0, config=True,
176 176
         help="set the iopub (PUB) port [default: random]")
177  
-    stdin_port = Int(0, config=True,
  177
+    stdin_port = Integer(0, config=True,
178 178
         help="set the stdin (XREQ) port [default: random]")
179 179
     connection_file = Unicode('', config=True,
180 180
         help="""JSON file in which to store connection info [default: kernel-<pid>.json]
4  IPython/frontend/terminal/interactiveshell.py
@@ -36,7 +36,7 @@
36 36
 from IPython.utils.process import abbrev_cwd
37 37
 from IPython.utils.warn import warn
38 38
 from IPython.utils.text import num_ini_spaces
39  
-from IPython.utils.traitlets import Int, CBool, Unicode
  39
+from IPython.utils.traitlets import Integer, CBool, Unicode
40 40
 
41 41
 #-----------------------------------------------------------------------------
42 42
 # Utilities
@@ -87,7 +87,7 @@ class TerminalInteractiveShell(InteractiveShell):
87 87
     pager = Unicode('less', config=True,
88 88
         help="The shell program to be used for paging.")
89 89
 
90  
-    screen_length = Int(0, config=True,
  90
+    screen_length = Integer(0, config=True,
91 91
         help=
92 92
         """Number of lines of your screen, used to control printing of very
93 93
         long strings.  Strings longer than this number of lines will be sent
8  IPython/parallel/apps/ipclusterapp.py
@@ -38,7 +38,7 @@
38 38
 from IPython.utils.daemonize import daemonize
39 39
 from IPython.utils.importstring import import_item
40 40
 from IPython.utils.sysinfo import num_cpus
41  
-from IPython.utils.traitlets import (Int, Unicode, Bool, CFloat, Dict, List, Any,
  41
+from IPython.utils.traitlets import (Integer, Unicode, Bool, CFloat, Dict, List, Any,
42 42
                                         DottedObjectName)
43 43
 
44 44
 from IPython.parallel.apps.baseapp import (
@@ -151,7 +151,7 @@ class IPClusterStop(BaseParallelApplication):
151 151
     examples = _stop_examples
152 152
     config_file_name = Unicode(default_config_file_name)
153 153
 
154  
-    signal = Int(signal.SIGINT, config=True,
  154
+    signal = Integer(signal.SIGINT, config=True,
155 155
         help="signal to use for stopping processes.")
156 156
 
157 157
     aliases = Dict(stop_aliases)
@@ -229,7 +229,7 @@ def _classes_default(self):
229 229
         eslaunchers = [ l for l in launchers if 'EngineSet' in l.__name__]
230 230
         return [ProfileDir]+eslaunchers
231 231
 
232  
-    n = Int(num_cpus(), config=True,
  232
+    n = Integer(num_cpus(), config=True,
233 233
         help="""The number of engines to start. The default is to use one for each
234 234
         CPU on your machine""")
235 235
 
@@ -282,7 +282,7 @@ def _daemonize_changed(self, name, old, new):
282 282
         if new:
283 283
             self.log_to_file = True
284 284
 
285  
-    early_shutdown = Int(30, config=True, help="The timeout (in seconds)")
  285
+    early_shutdown = Integer(30, config=True, help="The timeout (in seconds)")
286 286
     _stopping = False
287 287
     
288 288
     aliases = Dict(engine_aliases)
10  IPython/parallel/apps/launcher.py
@@ -58,7 +58,7 @@ def check_output(*args, **kwargs):
58 58
 from IPython.config.configurable import LoggingConfigurable
59 59
 from IPython.utils.text import EvalFormatter
60 60
 from IPython.utils.traitlets import (
61  
-    Any, Int, CFloat, List, Unicode, Dict, Instance, HasTraits,
  61
+    Any, Integer, CFloat, List, Unicode, Dict, Instance, HasTraits,
62 62
 )
63 63
 from IPython.utils.path import get_ipython_module_path
64 64
 from IPython.utils.process import find_cmd, pycmd2argv, FindCmdError
@@ -258,7 +258,7 @@ class LocalProcessLauncher(BaseLauncher):
258 258
     # This is used to to construct self.args, which is passed to
259 259
     # spawnProcess.
260 260
     cmd_and_args = List([])
261  
-    poll_frequency = Int(100) # in ms
  261
+    poll_frequency = Integer(100) # in ms
262 262
 
263 263
     def __init__(self, work_dir=u'.', config=None, **kwargs):
264 264
         super(LocalProcessLauncher, self).__init__(
@@ -458,7 +458,7 @@ class MPIExecLauncher(LocalProcessLauncher):
458 458
     program_args = List([],
459 459
         help="The command line argument to the program."
460 460
     )
461  
-    n = Int(1)
  461
+    n = Integer(1)
462 462
 
463 463
     def find_args(self):
464 464
         """Build self.args using all the fields."""
@@ -854,7 +854,7 @@ class BatchSystemLauncher(BaseLauncher):
854 854
     def _queue_changed(self, name, old, new):
855 855
         self.context[name] = new
856 856
 
857  
-    n = Int(1)
  857
+    n = Integer(1)
858 858
     _n_changed = _queue_changed
859 859
 
860 860
     # not configurable, override in subclasses
@@ -1121,7 +1121,7 @@ class IPClusterLauncher(LocalProcessLauncher):
1121 1121
         ['--clean-logs', '--log-to-file', '--log-level=%i'%logging.INFO], config=True,
1122 1122
         help="Command line arguments to pass to ipcluster.")
1123 1123
     ipcluster_subcommand = Unicode('start')
1124  
-    ipcluster_n = Int(2)
  1124
+    ipcluster_n = Integer(2)
1125 1125
 
1126 1126
     def find_args(self):
1127 1127
         return self.ipcluster_cmd + [self.ipcluster_subcommand] + \
50  IPython/parallel/apps/winhpcjob.py
@@ -29,7 +29,7 @@
29 29
 
30 30
 from IPython.config.configurable import Configurable
31 31
 from IPython.utils.traitlets import (
32  
-    Unicode, Int, List, Instance,
  32
+    Unicode, Integer, List, Instance,
33 33
     Enum, Bool
34 34
 )
35 35
 
@@ -81,12 +81,12 @@ class WinHPCJob(Configurable):
81 81
 
82 82
     job_id = Unicode('')
83 83
     job_name = Unicode('MyJob', config=True)
84  
-    min_cores = Int(1, config=True)
85  
-    max_cores = Int(1, config=True)
86  
-    min_sockets = Int(1, config=True)
87  
-    max_sockets = Int(1, config=True)
88  
-    min_nodes = Int(1, config=True)
89  
-    max_nodes = Int(1, config=True)
  84
+    min_cores = Integer(1, config=True)
  85
+    max_cores = Integer(1, config=True)
  86
+    min_sockets = Integer(1, config=True)
  87
+    max_sockets = Integer(1, config=True)
  88
+    min_nodes = Integer(1, config=True)
  89
+    max_nodes = Integer(1, config=True)
90 90
     unit_type = Unicode("Core", config=True)
91 91
     auto_calculate_min = Bool(True, config=True)
92 92
     auto_calculate_max = Bool(True, config=True)
@@ -173,12 +173,12 @@ class WinHPCTask(Configurable):
173 173
     task_id = Unicode('')
174 174
     task_name = Unicode('')
175 175
     version = Unicode("2.000")
176  
-    min_cores = Int(1, config=True)
177  
-    max_cores = Int(1, config=True)
178  
-    min_sockets = Int(1, config=True)
179  
-    max_sockets = Int(1, config=True)
180  
-    min_nodes = Int(1, config=True)
181  
-    max_nodes = Int(1, config=True)
  176
+    min_cores = Integer(1, config=True)
  177
+    max_cores = Integer(1, config=True)
  178
+    min_sockets = Integer(1, config=True)
  179
+    max_sockets = Integer(1, config=True)
  180
+    min_nodes = Integer(1, config=True)
  181
+    max_nodes = Integer(1, config=True)
182 182
     unit_type = Unicode("Core", config=True)
183 183
     command_line = Unicode('', config=True)
184 184
     work_directory = Unicode('', config=True)
@@ -255,12 +255,12 @@ class IPControllerTask(WinHPCTask):
255 255
     # I don't want these to be configurable
256 256
     std_out_file_path = Unicode('', config=False)
257 257
     std_err_file_path = Unicode('', config=False)
258  
-    min_cores = Int(1, config=False)
259  
-    max_cores = Int(1, config=False)
260  
-    min_sockets = Int(1, config=False)
261  
-    max_sockets = Int(1, config=False)
262  
-    min_nodes = Int(1, config=False)
263  
-    max_nodes = Int(1, config=False)
  258
+    min_cores = Integer(1, config=False)
  259
+    max_cores = Integer(1, config=False)
  260
+    min_sockets = Integer(1, config=False)
  261
+    max_sockets = Integer(1, config=False)
  262
+    min_nodes = Integer(1, config=False)
  263
+    max_nodes = Integer(1, config=False)
264 264
     unit_type = Unicode("Core", config=False)
265 265
     work_directory = Unicode('', config=False)
266 266
 
@@ -283,12 +283,12 @@ class IPEngineTask(WinHPCTask):
283 283
     # I don't want these to be configurable
284 284
     std_out_file_path = Unicode('', config=False)
285 285
     std_err_file_path = Unicode('', config=False)
286  
-    min_cores = Int(1, config=False)
287  
-    max_cores = Int(1, config=False)
288  
-    min_sockets = Int(1, config=False)
289  
-    max_sockets = Int(1, config=False)
290  
-    min_nodes = Int(1, config=False)
291  
-    max_nodes = Int(1, config=False)
  286
+    min_cores = Integer(1, config=False)
  287
+    max_cores = Integer(1, config=False)
  288
+    min_sockets = Integer(1, config=False)
  289
+    max_sockets = Integer(1, config=False)
  290
+    min_nodes = Integer(1, config=False)
  291
+    max_nodes = Integer(1, config=False)
292 292
     unit_type = Unicode("Core", config=False)
293 293
     work_directory = Unicode('', config=False)
294 294
 
6  IPython/parallel/client/client.py
@@ -35,7 +35,7 @@
35 35
 from IPython.utils.jsonutil import rekey
36 36
 from IPython.utils.localinterfaces import LOCAL_IPS
37 37
 from IPython.utils.path import get_ipython_dir
38  
-from IPython.utils.traitlets import (HasTraits, Int, Instance, Unicode,
  38
+from IPython.utils.traitlets import (HasTraits, Integer, Instance, Unicode,
39 39
                                     Dict, List, Bool, Set)
40 40
 from IPython.external.decorator import decorator
41 41
 from IPython.external.ssh import tunnel
@@ -279,8 +279,8 @@ def _profile_default(self):
279 279
     _task_socket=Instance('zmq.Socket')
280 280
     _task_scheme=Unicode()
281 281
     _closed = False
282  
-    _ignored_control_replies=Int(0)
283  
-    _ignored_hub_replies=Int(0)
  282
+    _ignored_control_replies=Integer(0)
  283
+    _ignored_hub_replies=Integer(0)
284 284
 
285 285
     def __new__(self, *args, **kw):
286 286
         # don't raise on positional args
6  IPython/parallel/client/view.py
@@ -24,7 +24,9 @@
24 24
 import zmq
25 25
 
26 26
 from IPython.testing.skipdoctest import skip_doctest
27  
-from IPython.utils.traitlets import HasTraits, Any, Bool, List, Dict, Set, Int, Instance, CFloat, CInt
  27
+from IPython.utils.traitlets import (
  28
+    HasTraits, Any, Bool, List, Dict, Set, Instance, CFloat, Integer
  29
+)
28 30
 from IPython.external.decorator import decorator
29 31
 
30 32
 from IPython.parallel import util
@@ -795,7 +797,7 @@ class LoadBalancedView(View):
795 797
     follow=Any()
796 798
     after=Any()
797 799
     timeout=CFloat()
798  
-    retries = CInt(0)
  800
+    retries = Integer(0)
799 801
 
800 802
     _task_scheme = Any()
801 803
     _flag_names = List(['targets', 'block', 'track', 'follow', 'after', 'timeout', 'retries'])
22  IPython/parallel/controller/hub.py
@@ -29,7 +29,7 @@
29 29
 # internal:
30 30
 from IPython.utils.importstring import import_item
31 31
 from IPython.utils.traitlets import (
32  
-        HasTraits, Instance, Int, Unicode, Dict, Set, Tuple, CBytes, DottedObjectName
  32
+        HasTraits, Instance, Integer, Unicode, Dict, Set, Tuple, CBytes, DottedObjectName
33 33
         )
34 34
 
35 35
 from IPython.parallel import error, util
@@ -109,7 +109,7 @@ class EngineConnector(HasTraits):
109 109
     registration (str): identity of registration XREQ socket
110 110
     heartbeat (str): identity of heartbeat XREQ socket
111 111
     """
112  
-    id=Int(0)
  112
+    id=Integer(0)
113 113
     queue=CBytes()
114 114
     control=CBytes()
115 115
     registration=CBytes()
@@ -120,42 +120,42 @@ class HubFactory(RegistrationFactory):
120 120
     """The Configurable for setting up a Hub."""
121 121
 
122 122
     # port-pairs for monitoredqueues:
123  
-    hb = Tuple(Int,Int,config=True,
  123
+    hb = Tuple(Integer,Integer,config=True,
124 124
         help="""XREQ/SUB Port pair for Engine heartbeats""")
125 125
     def _hb_default(self):
126 126
         return tuple(util.select_random_ports(2))
127 127
 
128  
-    mux = Tuple(Int,Int,config=True,
  128
+    mux = Tuple(Integer,Integer,config=True,
129 129
         help="""Engine/Client Port pair for MUX queue""")
130 130
 
131 131
     def _mux_default(self):
132 132
         return tuple(util.select_random_ports(2))
133 133
 
134  
-    task = Tuple(Int,Int,config=True,
  134
+    task = Tuple(Integer,Integer,config=True,
135 135
         help="""Engine/Client Port pair for Task queue""")
136 136
     def _task_default(self):
137 137
         return tuple(util.select_random_ports(2))
138 138
 
139  
-    control = Tuple(Int,Int,config=True,
  139
+    control = Tuple(Integer,Integer,config=True,
140 140
         help="""Engine/Client Port pair for Control queue""")
141 141
 
142 142
     def _control_default(self):
143 143
         return tuple(util.select_random_ports(2))
144 144
 
145  
-    iopub = Tuple(Int,Int,config=True,
  145
+    iopub = Tuple(Integer,Integer,config=True,
146 146
         help="""Engine/Client Port pair for IOPub relay""")
147 147
 
148 148
     def _iopub_default(self):
149 149
         return tuple(util.select_random_ports(2))
150 150
 
151 151
     # single ports:
152  
-    mon_port = Int(config=True,
  152
+    mon_port = Integer(config=True,
153 153
         help="""Monitor (SUB) port for queue traffic""")
154 154
 
155 155
     def _mon_port_default(self):
156 156
         return util.select_random_ports(1)[0]
157 157
 
158  
-    notifier_port = Int(config=True,
  158
+    notifier_port = Integer(config=True,
159 159
         help="""PUB port for sending engine status notifications""")
160 160
 
161 161
     def _notifier_port_default(self):
@@ -331,8 +331,8 @@ class Hub(SessionFactory):
331 331
     dead_engines=Set() # completed msg_ids keyed by engine_id
332 332
     unassigned=Set() # set of task msg_ds not yet assigned a destination
333 333
     incoming_registrations=Dict()
334  
-    registration_timeout=Int()
335  
-    _idcounter=Int(0)
  334
+    registration_timeout=Integer()
  335
+    _idcounter=Integer(0)
336 336
 
337 337
     # objects from constructor:
338 338
     query=Instance(ZMQStream)
4  IPython/parallel/controller/scheduler.py
@@ -40,7 +40,7 @@
40 40
 from IPython.external.decorator import decorator
41 41
 from IPython.config.application import Application
42 42
 from IPython.config.loader import Config
43  
-from IPython.utils.traitlets import Instance, Dict, List, Set, Int, Enum, CBytes
  43
+from IPython.utils.traitlets import Instance, Dict, List, Set, Integer, Enum, CBytes
44 44
 
45 45
 from IPython.parallel import error
46 46
 from IPython.parallel.factory import SessionFactory
@@ -131,7 +131,7 @@ class TaskScheduler(SessionFactory):
131 131
 
132 132
     """
133 133
 
134  
-    hwm = Int(0, config=True, shortname='hwm',
  134
+    hwm = Integer(0, config=True, shortname='hwm',
135 135
         help="""specify the High Water Mark (HWM) for the downstream
136 136
         socket in the Task scheduler. This is the maximum number
137 137
         of allowed outstanding tasks on each engine."""
4  IPython/parallel/engine/engine.py
@@ -25,7 +25,7 @@
25 25
 from IPython.external.ssh import tunnel
26 26
 # internal
27 27
 from IPython.utils.traitlets import (
28  
-    Instance, Dict, Int, Type, CFloat, Unicode, CBytes, Bool
  28
+    Instance, Dict, Integer, Type, CFloat, Unicode, CBytes, Bool
29 29
 )
30 30
 # from IPython.utils.localinterfaces import LOCALHOST
31 31
 
@@ -63,7 +63,7 @@ class EngineFactory(RegistrationFactory):
63 63
 
64 64
     # not configurable:
65 65
     user_ns=Dict()
66  
-    id=Int(allow_none=True)
  66
+    id=Integer(allow_none=True)
67 67
     registrar=Instance('zmq.eventloop.zmqstream.ZMQStream')
68 68
     kernel=Instance(Kernel)
69 69
 
4  IPython/parallel/engine/streamkernel.py
@@ -34,7 +34,7 @@
34 34
 from zmq.eventloop import ioloop, zmqstream
35 35
 
36 36
 # Local imports.
37  
-from IPython.utils.traitlets import Instance, List, Int, Dict, Set, Unicode, CBytes
  37
+from IPython.utils.traitlets import Instance, List, Integer, Dict, Set, Unicode, CBytes
38 38
 from IPython.zmq.completer import KernelCompleter
39 39
 
40 40
 from IPython.parallel.error import wrap_exception
@@ -74,7 +74,7 @@ class Kernel(SessionFactory):
74 74
         help="List of lines to execute")
75 75
 
76 76
     # identities:
77  
-    int_id = Int(-1)
  77
+    int_id = Integer(-1)
78 78
     bident = CBytes()
79 79
     ident = Unicode()
80 80
     def _ident_changed(self, name, old, new):
4  IPython/parallel/factory.py
@@ -24,7 +24,7 @@
24 24
 from zmq.eventloop.ioloop import IOLoop
25 25
 
26 26
 from IPython.config.configurable import Configurable
27  
-from IPython.utils.traitlets import Int, Instance, Unicode
  27
+from IPython.utils.traitlets import Integer, Instance, Unicode
28 28
 
29 29
 from IPython.parallel.util import select_random_ports
30 30
 from IPython.zmq.session import Session, SessionFactory
@@ -48,7 +48,7 @@ class RegistrationFactory(SessionFactory):
48 48
         help="""The IP address for registration.  This is generally either
49 49
         '127.0.0.1' for loopback only or '*' for all interfaces.
50 50
         [default: '127.0.0.1']""")
51  
-    regport = Int(config=True,
  51
+    regport = Integer(config=True,
52 52
         help="""The port on which the Hub listens for registration.""")
53 53
     def _regport_default(self):
54 54
         return select_random_ports(1)[0]
39  IPython/utils/tests/test_traitlets.py
@@ -26,11 +26,12 @@
26 26
 
27 27
 from IPython.utils.traitlets import (
28 28
     HasTraits, MetaHasTraits, TraitType, Any, CBytes,
29  
-    Int, Long, Float, Complex, Bytes, Unicode, TraitError,
  29
+    Int, Long, Integer, Float, Complex, Bytes, Unicode, TraitError,
30 30
     Undefined, Type, This, Instance, TCPAddress, List, Tuple,
31 31
     ObjectName, DottedObjectName
32 32
 )
33 33
 from IPython.utils import py3compat
  34
+from IPython.testing.decorators import skipif
34 35
 
35 36
 #-----------------------------------------------------------------------------
36 37
 # Helper classes for testing
@@ -630,6 +631,11 @@ def test_bad_values(self):
630 631
     def test_default_value(self):
631 632
         if hasattr(self, '_default_value'):
632 633
             self.assertEquals(self._default_value, self.obj.value)
  634
+    
  635
+    def tearDown(self):
  636
+        # restore default value after tests, if set
  637
+        if hasattr(self, '_default_value'):
  638
+            self.obj.value = self._default_value
633 639
 
634 640
 
635 641
 class AnyTrait(HasTraits):
@@ -658,7 +664,7 @@ class TestInt(TraitTestBase):
658 664
                       10.1, -10.1, '10L', '-10L', '10.1', '-10.1', u'10L',
659 665
                       u'-10L', u'10.1', u'-10.1',  '10', '-10', u'10', u'-10']
660 666
     if not py3compat.PY3:
661  
-        _bad_values.extend([10L, -10L])
  667
+        _bad_values.extend([10L, -10L, 10*sys.maxint, -10*sys.maxint])
662 668
 
663 669
 
664 670
 class LongTrait(HasTraits):
@@ -675,6 +681,35 @@ class TestLong(TraitTestBase):
675 681
                       None, 1j, 10.1, -10.1, '10', '-10', '10L', '-10L', '10.1',
676 682
                       '-10.1', u'10', u'-10', u'10L', u'-10L', u'10.1',
677 683
                       u'-10.1']
  684
+    if not py3compat.PY3:
  685
+        # maxint undefined on py3, because int == long
  686
+        _good_values.extend([10*sys.maxint, -10*sys.maxint])
  687
+    
  688
+    @skipif(py3compat.PY3, "not relevant on py3")
  689
+    def test_cast_small(self):
  690
+        """Long casts ints to long"""
  691
+        self.obj.value = 10
  692
+        self.assertEquals(type(self.obj.value), long)
  693
+        
  694
+
  695
+class IntegerTrait(HasTraits):
  696
+    value = Integer(1)
  697
+    
  698
+class TestInteger(TestLong):
  699
+    obj = IntegerTrait()
  700
+    _default_value = 1
  701
+    
  702
+    def coerce(self, n):
  703
+        return int(n)
  704
+    
  705
+    @skipif(py3compat.PY3, "not relevant on py3")
  706
+    def test_cast_small(self):
  707
+        """Integer casts small longs to int"""
  708
+        if py3compat.PY3:
  709
+            raise SkipTest("not relevant on py3")
  710
+        
  711
+        self.obj.value = 100L
  712
+        self.assertEquals(type(self.obj.value), int)
678 713
 
679 714
 
680 715
 class FloatTrait(HasTraits):
23  IPython/utils/traitlets.py
@@ -863,10 +863,10 @@ class Any(TraitType):
863 863
 
864 864
 
865 865
 class Int(TraitType):
866  
-    """A integer trait."""
  866
+    """An int trait."""
867 867
 
868 868
     default_value = 0
869  
-    info_text = 'an integer'
  869
+    info_text = 'an int'
870 870
 
871 871
     def validate(self, obj, value):
872 872
         if isinstance(value, int):
@@ -884,6 +884,7 @@ def validate(self, obj, value):
884 884
 
885 885
 if py3compat.PY3:
886 886
     Long, CLong = Int, CInt
  887
+    Integer = Int
887 888
 else:
888 889
     class Long(TraitType):
889 890
         """A long integer trait."""
@@ -908,6 +909,24 @@ def validate(self, obj, value):
908 909
             except:
909 910
                 self.error(obj, value)
910 911
 
  912
+    class Integer(TraitType):
  913
+        """An integer trait.
  914
+        
  915
+        Longs that are unnecessary (<= sys.maxint) are cast to ints."""
  916
+
  917
+        default_value = 0
  918
+        info_text = 'an integer'
  919
+
  920
+        def validate(self, obj, value):
  921
+            if isinstance(value, int):
  922
+                return value
  923
+            elif isinstance(value, long):
  924
+                # downcast longs that fit in int:
  925
+                # note that int(n > sys.maxint) returns a long, so
  926
+                # we don't need a condition on this cast
  927
+                return int(value)
  928
+            self.error(obj, value)
  929
+
911 930
 
912 931
 class Float(TraitType):
913 932
     """A float trait."""
2  IPython/zmq/ipkernel.py
@@ -39,7 +39,7 @@
39 39
 from IPython.utils.jsonutil import json_clean
40 40
 from IPython.lib import pylabtools
41 41
 from IPython.utils.traitlets import (
42  
-    Any, List, Instance, Float, Dict, Bool, Int, Unicode, CaselessStrEnum
  42
+    Any, List, Instance, Float, Dict, Bool, Unicode, CaselessStrEnum
43 43
 )
44 44
 
45 45
 from entry_point import base_launch_kernel
14  IPython/zmq/kernelapp.py
@@ -32,7 +32,7 @@
32 32
 from IPython.utils.localinterfaces import LOCALHOST
33 33
 from IPython.utils.path import filefind
34 34
 from IPython.utils.py3compat import str_to_bytes
35  
-from IPython.utils.traitlets import (Any, Instance, Dict, Unicode, Int, Bool,
  35
+from IPython.utils.traitlets import (Any, Instance, Dict, Unicode, Integer, Bool,
36 36
                                         DottedObjectName)
37 37
 from IPython.utils.importstring import import_item
38 38
 # local imports
@@ -107,10 +107,10 @@ def _parent_appname_changed(self, name, old, new):
107 107
     # connection info:
108 108
     ip = Unicode(LOCALHOST, config=True,
109 109
         help="Set the IP or interface on which the kernel will listen.")
110  
-    hb_port = Int(0, config=True, help="set the heartbeat port [default: random]")
111  
-    shell_port = Int(0, config=True, help="set the shell (XREP) port [default: random]")
112  
-    iopub_port = Int(0, config=True, help="set the iopub (PUB) port [default: random]")
113  
-    stdin_port = Int(0, config=True, help="set the stdin (XREQ) port [default: random]")
  110
+    hb_port = Integer(0, config=True, help="set the heartbeat port [default: random]")
  111
+    shell_port = Integer(0, config=True, help="set the shell (XREP) port [default: random]")
  112
+    iopub_port = Integer(0, config=True, help="set the iopub (PUB) port [default: random]")
  113
+    stdin_port = Integer(0, config=True, help="set the stdin (XREQ) port [default: random]")
114 114
     connection_file = Unicode('', config=True, 
115 115
     help="""JSON file in which to store connection info [default: kernel-<pid>.json]
116 116
     
@@ -128,11 +128,11 @@ def _parent_appname_changed(self, name, old, new):
128 128
         config=True, help="The importstring for the DisplayHook factory")
129 129
 
130 130
     # polling
131  
-    parent = Int(0, config=True,
  131
+    parent = Integer(0, config=True,
132 132
         help="""kill this process if its parent dies.  On Windows, the argument
133 133
         specifies the HANDLE of the parent process, otherwise it is simply boolean.
134 134
         """)
135  
-    interrupt = Int(0, config=True,
  135
+    interrupt = Integer(0, config=True,
136 136
         help="""ONLY USED ON WINDOWS
137 137
         Interrupt this process when the parent is signalled.
138 138
         """)
10  IPython/zmq/kernelmanager.py
@@ -35,7 +35,7 @@
35 35
 from IPython.config.loader import Config
36 36
 from IPython.utils.localinterfaces import LOCALHOST, LOCAL_IPS
37 37
 from IPython.utils.traitlets import (
38  
-    HasTraits, Any, Instance, Type, Unicode, Int, Bool
  38
+    HasTraits, Any, Instance, Type, Unicode, Integer, Bool
39 39
 )
40 40
 from IPython.utils.py3compat import str_to_bytes
41 41